forked from loafle/openapi-generator-original
* first pass * fixing types * fixing action * updating samples * updating files * adding guido * fixing misk * removing old files * cleaning generated files * cleaning generated files * adding back in license * first pass * second pass * third pass * typo * fixup * fixup 2 * fixup 3 * fixup 4 * fixup 5 * fixup 6 * fixing api override * fixing docs * fixing docs json * fix misk version * add action prefix * fixup * fixup 2 * fixup 3 * fixup 4 * fixup 5
4.8 KiB
4.8 KiB
StoreApi
All URIs are relative to http://petstore.swagger.io/v2
Method | HTTP request | Description |
---|---|---|
deleteOrder | Delete /store/order/{orderId} | Delete purchase order by ID |
getInventory | Get /store/inventory | Returns pet inventories by status |
getOrderById | Get /store/order/{orderId} | Find purchase order by ID |
placeOrder | Post /store/order | Place an order for a pet |
deleteOrder
deleteOrder(orderId)
Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Example
// Import classes:
//import org.openapitools.infrastructure.*
//import org.openapitools.server.api.model.*
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
getInventory
kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory()
Returns pet inventories by status
Returns a map of status codes to quantities
Example
// Import classes:
//import org.openapitools.infrastructure.*
//import org.openapitools.server.api.model.*
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<kotlin.String, kotlin.Int>
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: MediaTypes.APPLICATION_JSON
getOrderById
Order getOrderById(orderId)
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
Example
// Import classes:
//import org.openapitools.infrastructure.*
//import org.openapitools.server.api.model.*
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
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON
placeOrder
Order placeOrder(order)
Place an order for a pet
Example
// Import classes:
//import org.openapitools.infrastructure.*
//import org.openapitools.server.api.model.*
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 placed for purchasing the pet |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: MediaTypes.APPLICATION_JSON
- Accept: MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON