feat: add option to support non-ascii headers in kotlin client (#20331)

This commit is contained in:
Kirill Romanov
2024-12-15 11:46:42 +03:00
committed by GitHub
parent 07d19baf89
commit 4e5a828c12
79 changed files with 5029 additions and 23 deletions

View File

@@ -0,0 +1,12 @@
# ModelApiResponse
## Properties
| Name | Type | Description | Notes |
| ------------ | ------------- | ------------- | ------------- |
| **code** | **kotlin.Int** | | [optional] |
| **type** | **kotlin.String** | | [optional] |
| **message** | **kotlin.String** | | [optional] |

View File

@@ -0,0 +1,11 @@
# Category
## Properties
| Name | Type | Description | Notes |
| ------------ | ------------- | ------------- | ------------- |
| **id** | **kotlin.Long** | | [optional] |
| **name** | **kotlin.String** | | [optional] |

View File

@@ -0,0 +1,22 @@
# 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] |
<a id="Status"></a>
## Enum: status
| Name | Value |
| ---- | ----- |
| status | placed, approved, delivered |

View File

@@ -0,0 +1,22 @@
# Pet
## Properties
| Name | Type | Description | Notes |
| ------------ | ------------- | ------------- | ------------- |
| **name** | **kotlin.String** | | |
| **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | | |
| **id** | **kotlin.Long** | | [optional] |
| **category** | [**Category**](Category.md) | | [optional] |
| **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional] |
| **status** | [**inline**](#Status) | pet status in the store | [optional] |
<a id="Status"></a>
## Enum: status
| Name | Value |
| ---- | ----- |
| status | available, pending, sold |

View File

@@ -0,0 +1,409 @@
# 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 |
<a id="addPet"></a>
# **addPet**
> Pet addPet(pet)
Add a new pet to the store
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val pet : Pet = // Pet | Pet object that needs to be added to the store
try {
val result : Pet = apiInstance.addPet(pet)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#addPet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#addPet")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
### Return type
[**Pet**](Pet.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a id="deletePet"></a>
# **deletePet**
> deletePet(petId, apiKey)
Deletes a pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete
val apiKey : kotlin.String = apiKey_example // kotlin.String |
try {
apiInstance.deletePet(petId, apiKey)
} catch (e: ClientException) {
println("4xx response calling PetApi#deletePet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#deletePet")
e.printStackTrace()
}
```
### Parameters
| **petId** | **kotlin.Long**| Pet id to delete | |
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **apiKey** | **kotlin.String**| | [optional] |
### Return type
null (empty response body)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a id="findPetsByStatus"></a>
# **findPetsByStatus**
> kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try {
val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#findPetsByStatus")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] |
### Return type
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a id="findPetsByTags"></a>
# **findPetsByTags**
> kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
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.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try {
val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#findPetsByTags")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | |
### Return type
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a id="getPetById"></a>
# **getPetById**
> Pet getPetById(petId)
Find pet by ID
Returns a single pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return
try {
val result : Pet = apiInstance.getPetById(petId)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#getPetById")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#getPetById")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **petId** | **kotlin.Long**| ID of pet to return | |
### Return type
[**Pet**](Pet.md)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a id="updatePet"></a>
# **updatePet**
> Pet updatePet(pet)
Update an existing pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val pet : Pet = // Pet | Pet object that needs to be added to the store
try {
val result : Pet = apiInstance.updatePet(pet)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#updatePet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#updatePet")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
### Return type
[**Pet**](Pet.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a id="updatePetWithForm"></a>
# **updatePetWithForm**
> updatePetWithForm(petId, name, status)
Updates a pet in the store with form data
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
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
try {
apiInstance.updatePetWithForm(petId, name, status)
} catch (e: ClientException) {
println("4xx response calling PetApi#updatePetWithForm")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#updatePetWithForm")
e.printStackTrace()
}
```
### Parameters
| **petId** | **kotlin.Long**| ID of pet that needs to be updated | |
| **name** | **kotlin.String**| Updated name of the pet | [optional] |
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **status** | **kotlin.String**| Updated status of the pet | [optional] |
### Return type
null (empty response body)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a id="uploadFile"></a>
# **uploadFile**
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
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
try {
val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#uploadFile")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#uploadFile")
e.printStackTrace()
}
```
### Parameters
| **petId** | **kotlin.Long**| ID of pet to update | |
| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] |
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **file** | **java.io.File**| file to upload | [optional] |
### Return type
[**ModelApiResponse**](ModelApiResponse.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json

View File

@@ -0,0 +1,195 @@
# 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 |
<a id="deleteOrder"></a>
# **deleteOrder**
> deleteOrder(orderId)
Delete purchase order by ID
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted
try {
apiInstance.deleteOrder(orderId)
} catch (e: ClientException) {
println("4xx response calling StoreApi#deleteOrder")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#deleteOrder")
e.printStackTrace()
}
```
### 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
<a id="getInventory"></a>
# **getInventory**
> kotlin.collections.Map&lt;kotlin.String, kotlin.Int&gt; getInventory()
Returns pet inventories by status
Returns a map of status codes to quantities
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
try {
val result : kotlin.collections.Map<kotlin.String, kotlin.Int> = apiInstance.getInventory()
println(result)
} catch (e: ClientException) {
println("4xx response calling StoreApi#getInventory")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#getInventory")
e.printStackTrace()
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**kotlin.collections.Map&lt;kotlin.String, kotlin.Int&gt;**
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a id="getOrderById"></a>
# **getOrderById**
> Order getOrderById(orderId)
Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched
try {
val result : Order = apiInstance.getOrderById(orderId)
println(result)
} catch (e: ClientException) {
println("4xx response calling StoreApi#getOrderById")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#getOrderById")
e.printStackTrace()
}
```
### 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/json
<a id="placeOrder"></a>
# **placeOrder**
> Order placeOrder(order)
Place an order for a pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
val order : Order = // Order | order placed for purchasing the pet
try {
val result : Order = apiInstance.placeOrder(order)
println(result)
} catch (e: ClientException) {
println("4xx response calling StoreApi#placeOrder")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#placeOrder")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **order** | [**Order**](Order.md)| order placed for purchasing the pet | |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,11 @@
# Tag
## Properties
| Name | Type | Description | Notes |
| ------------ | ------------- | ------------- | ------------- |
| **id** | **kotlin.Long** | | [optional] |
| **name** | **kotlin.String** | | [optional] |

View File

@@ -0,0 +1,17 @@
# 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] |

View File

@@ -0,0 +1,397 @@
# 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 |
<a id="createUser"></a>
# **createUser**
> createUser(user)
Create user
This can only be done by the logged in user.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val user : User = // User | Created user object
try {
apiInstance.createUser(user)
} catch (e: ClientException) {
println("4xx response calling UserApi#createUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#createUser")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **user** | [**User**](User.md)| Created user object | |
### Return type
null (empty response body)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a id="createUsersWithArrayInput"></a>
# **createUsersWithArrayInput**
> createUsersWithArrayInput(user)
Creates list of users with given input array
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try {
apiInstance.createUsersWithArrayInput(user)
} catch (e: ClientException) {
println("4xx response calling UserApi#createUsersWithArrayInput")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#createUsersWithArrayInput")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object | |
### Return type
null (empty response body)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a id="createUsersWithListInput"></a>
# **createUsersWithListInput**
> createUsersWithListInput(user)
Creates list of users with given input array
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try {
apiInstance.createUsersWithListInput(user)
} catch (e: ClientException) {
println("4xx response calling UserApi#createUsersWithListInput")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#createUsersWithListInput")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object | |
### Return type
null (empty response body)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a id="deleteUser"></a>
# **deleteUser**
> deleteUser(username)
Delete user
This can only be done by the logged in user.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted
try {
apiInstance.deleteUser(username)
} catch (e: ClientException) {
println("4xx response calling UserApi#deleteUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#deleteUser")
e.printStackTrace()
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **username** | **kotlin.String**| The name that needs to be deleted | |
### Return type
null (empty response body)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a id="getUserByName"></a>
# **getUserByName**
> User getUserByName(username)
Get user by user name
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing.
try {
val result : User = apiInstance.getUserByName(username)
println(result)
} catch (e: ClientException) {
println("4xx response calling UserApi#getUserByName")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#getUserByName")
e.printStackTrace()
}
```
### 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/json
<a id="loginUser"></a>
# **loginUser**
> kotlin.String loginUser(username, password)
Logs user into the system
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
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
try {
val result : kotlin.String = apiInstance.loginUser(username, password)
println(result)
} catch (e: ClientException) {
println("4xx response calling UserApi#loginUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#loginUser")
e.printStackTrace()
}
```
### Parameters
| **username** | **kotlin.String**| The user name for login | |
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **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/json
<a id="logoutUser"></a>
# **logoutUser**
> logoutUser()
Logs out current logged in user session
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
try {
apiInstance.logoutUser()
} catch (e: ClientException) {
println("4xx response calling UserApi#logoutUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#logoutUser")
e.printStackTrace()
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
null (empty response body)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a id="updateUser"></a>
# **updateUser**
> updateUser(username, user)
Updated user
This can only be done by the logged in user.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | name that need to be deleted
val user : User = // User | Updated user object
try {
apiInstance.updateUser(username, user)
} catch (e: ClientException) {
println("4xx response calling UserApi#updateUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#updateUser")
e.printStackTrace()
}
```
### Parameters
| **username** | **kotlin.String**| name that need to be deleted | |
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **user** | [**User**](User.md)| Updated user object | |
### Return type
null (empty response body)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined