gleam-spacetraders-sdk/src/models/siphon.gleam
Lily Rose cc8edbed02
Some checks are pending
test / test (push) Waiting to run
Add functioning sdk
2025-06-17 01:43:06 +10:00

13 lines
428 B
Gleam

import gleam/dynamic/decode.{type Decoder}
import models/ship_symbol.{type ShipSymbol}
import models/siphon_yield.{type SiphonYield}
pub type Siphon {
Siphon(ship_symbol: ShipSymbol, yield: SiphonYield)
}
pub fn decoder() -> Decoder(Siphon) {
use ship_symbol <- decode.field("shipSymbol", ship_symbol.decoder())
use yield <- decode.field("yield", siphon_yield.decoder())
decode.success(Siphon(ship_symbol:, yield:))
}