Last active
April 20, 2020 08:17
-
-
Save viggin543/ec72ceec50345dcbb2162c8ac36c36e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BananaApi { | |
| fun getBanana(id: String): Banana { | |
| return Banana(Color.GREEN, 0.5, id) | |
| } | |
| fun deleteBanana(id: String) { | |
| println("delete banana with id $id") | |
| } | |
| fun createBanana(banana: CreateBanana) { | |
| println("created $banana") | |
| } | |
| } | |
| data class Banana(val color: Color, | |
| val price: Double, | |
| val id: String, | |
| val nickname: String? = null) | |
| data class CreateBanana( | |
| val color: String, | |
| val price: Double) | |
| data class ApiError(val error: String) | |
| enum class Color { | |
| GREEN, YELLOW, BROWN | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment