Skip to content

Instantly share code, notes, and snippets.

@krzdabrowski
Created August 5, 2022 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzdabrowski/6be2d8bb458c8ddac3c5b7479c41636e to your computer and use it in GitHub Desktop.
Save krzdabrowski/6be2d8bb458c8ddac3c5b7479c41636e to your computer and use it in GitHub Desktop.
@Serializable
data class RocketResponse(
@SerialName("id")
val id: String = "",
@SerialName("name")
val name: String = "",
@SerialName("cost_per_launch")
val costPerLaunch: Int = 0,
@SerialName("first_flight")
val firstFlightDate: String = "",
@SerialName("height")
val height: Height = Height(),
@SerialName("mass")
val weight: Weight = Weight(),
@SerialName("wikipedia")
val wikiUrl: String = "",
@SerialName("flickr_images")
val imageUrls: List<String> = emptyList()
) {
@Serializable
data class Height(
val meters: Double = 0.0,
val feet: Double = 0.0
)
@Serializable
data class Weight(
val kg: Int = 0,
val lb: Int = 0
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment