gleam-spacetraders-sdk/src/models/ship_fuel_consumed.gleam
Lily Rose 64f3729d0c
Some checks are pending
test / test (push) Waiting to run
Refactoring and general tidying up
2025-06-17 19:04:29 +10:00

13 lines
387 B
Gleam

import birl.{type Time}
import gleam/dynamic/decode.{type Decoder}
import utils/api
pub type ShipFuelConsumed {
ShipFuelConsumed(amount: Int, timestamp: Time)
}
pub fn decoder() -> Decoder(ShipFuelConsumed) {
use amount <- decode.field("amount", decode.int)
use timestamp <- decode.field("timestamp", api.time_decoder())
decode.success(ShipFuelConsumed(amount:, timestamp:))
}