diff --git a/src/main/kotlin/net/tcgdex/sdk/models/Card.kt b/src/main/kotlin/net/tcgdex/sdk/models/Card.kt index 3b6bb0d..808fbbf 100644 --- a/src/main/kotlin/net/tcgdex/sdk/models/Card.kt +++ b/src/main/kotlin/net/tcgdex/sdk/models/Card.kt @@ -62,6 +62,10 @@ data class Card internal constructor( */ val set: SetResume, + /** + * Market pricing information + */ + val pricing: Pricing?, /** * the Pokémon Pokédex IDs (multiple if multiple pokémon appears on the card) diff --git a/src/main/kotlin/net/tcgdex/sdk/models/Pricing.kt b/src/main/kotlin/net/tcgdex/sdk/models/Pricing.kt new file mode 100644 index 0000000..cc26c06 --- /dev/null +++ b/src/main/kotlin/net/tcgdex/sdk/models/Pricing.kt @@ -0,0 +1,13 @@ +package net.tcgdex.sdk.models + +import net.tcgdex.sdk.internal.Model +import net.tcgdex.sdk.models.subs.PricingCardMarket +import net.tcgdex.sdk.models.subs.PricingTcgPlayer + +/** + * Pokémon TCG Pricing class + */ +data class Pricing internal constructor( + val tcgplayer: PricingTcgPlayer?, + val cardmarket: PricingCardMarket? +) : Model() diff --git a/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingCardMarket.kt b/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingCardMarket.kt new file mode 100644 index 0000000..8f094c9 --- /dev/null +++ b/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingCardMarket.kt @@ -0,0 +1,85 @@ +package net.tcgdex.sdk.models.subs + +import com.google.gson.annotations.SerializedName +import net.tcgdex.sdk.internal.Model + +/** + * Pokémon TCG PricingCardMarket class + */ +data class PricingCardMarket internal constructor( + /** + * Indicate when is the last time it was fetched + */ + val updated: String?, + + /** + * Indicate the unit in which the card is sold + */ + val unit: String?, + + /** + * Average selling price (non-foil) + */ + val avg: Float?, + + /** + * Lowest market price (non-foil) + */ + val low: Float?, + + /** + * Trend price from charts (non-foil) + */ + val trend: Float?, + + /** + * Average price (last 24 hours) + */ + val avg1: Float?, + + /** + * Average price (last 7 days) + */ + val avg7: Float?, + + /** + * Average price (last 30 days) + */ + val avg30: Float?, + + /** + * Average selling price (foil) + */ + @SerializedName("avg-holo") + val avgHolo: Float?, + + /** + * Lowest market price (foil) + */ + @SerializedName("low-holo") + val lowHolo: Float?, + + /** + * Trend price from charts (foil) + */ + @SerializedName("trend-holo") + val trendHolo: Float?, + + /** + * Average price (last 24 hours, foil) + */ + @SerializedName("avg1-holo") + val avg1Holo: Float?, + + /** + * Average price (last 7 days, foil) + */ + @SerializedName("avg7-holo") + val avg7Holo: Float?, + + /** + * Average price (last 30 days, foil) + */ + @SerializedName("avg30-holo") + val avg30Holo: Float? +) : Model() diff --git a/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingTcgPlayer.kt b/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingTcgPlayer.kt new file mode 100644 index 0000000..137c89f --- /dev/null +++ b/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingTcgPlayer.kt @@ -0,0 +1,58 @@ +package net.tcgdex.sdk.models.subs + +import com.google.gson.annotations.SerializedName +import net.tcgdex.sdk.internal.Model + +/** + * Pokémon TCG PricingTcgPlayer class + */ +data class PricingTcgPlayer internal constructor( + /** + * Indicate when is the last time it was fetched + */ + val updated: String, + + /** + * Indicate the unit in which the card is sold + */ + val unit: String, + + /** + * Standard non-foil cards + */ + val normal: PricingTcgPlayerVariant?, + + /** + * Holofoil finish cards + */ + val holoFoil: PricingTcgPlayerVariant?, + + /** + * Reverse holofoil cards + */ + @SerializedName("reverse-holofoil") + val reverseHolofoil: PricingTcgPlayerVariant?, + + /** + * First edition cards + */ + @SerializedName("1st-edition") + val firstEdition: PricingTcgPlayerVariant?, + + /** + * First edition holofoil cards + */ + @SerializedName("1st-edition-holofoil") + val firstEditionHolofoil: PricingTcgPlayerVariant?, + + /** + * Unlimited edition cards + */ + val unlimited: PricingTcgPlayerVariant?, + + /** + * Unlimited holofoil cards + */ + @SerializedName("unlimited-holofoil") + val unlimitedHolofoil: PricingTcgPlayerVariant? +) : Model() diff --git a/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingTcgPlayerVariant.kt b/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingTcgPlayerVariant.kt new file mode 100644 index 0000000..714dfea --- /dev/null +++ b/src/main/kotlin/net/tcgdex/sdk/models/subs/PricingTcgPlayerVariant.kt @@ -0,0 +1,31 @@ +package net.tcgdex.sdk.models.subs + +/** + * Pokémon TCG PricingTcgPlayerVariant class + */ +data class PricingTcgPlayerVariant internal constructor( + /** + * Lowest available price + */ + val lowPrice: Float?, + + /** + * Median market price + */ + val midPrice: Float?, + + /** + * Highest available price + */ + val highPrice: Float?, + + /** + * Current market price + */ + val marketPrice: Float?, + + /** + * Lowest direct seller price + */ + val directLowPrice: Float? +)