sorare/shop_item.go

46 lines
1.6 KiB
Go

package sorare
import (
"time"
)
type ShopItem struct {
TypeName string `graphql:"__typename"`
ShopItemInterface struct {
Id string `graphql:"id"`
Name string `graphql:"name"`
Price int `graphql:"price"`
MyBalance int `graphql:"myBalance"`
LimitPerUser int `graphql:"limitPerUser"`
MyLimitResetAt time.Time `graphql:"myLimitResetAt"`
MyPurchasesCount int `graphql:"myPurchasesCount"`
} `graphql:"... on ShopItemInterface"`
JerseyShopItem struct {
CurrentStockCount int `graphql:"currentStockCount"`
InitialStockCount int `graphql:"initialStockCount"`
} `graphql:"... on JerseyShopItem"`
LevelUpShopItem struct {
Rarity string `graphql:"rarity"`
} `graphql:"... on LevelUpShopItem"`
}
type ShopItemType string
const (
ShopItemTypeJersey ShopItemType = "JERSEY"
ShopItemTypeBanner ShopItemType = "BANNER"
ShopItemTypeLogo ShopItemType = "LOGO"
ShopItemTypeShield ShopItemType = "SHIELD"
ShopItemTypeLevelUp ShopItemType = "LEVEL_UP"
ShopItemTypeExtraSwap ShopItemType = "EXTRA_SWAP"
ShopItemTypeExtraTeamsCap ShopItemType = "EXTRA_TEAMS_CAP"
ShopItemTypeRecoveryKit ShopItemType = "RECOVERY_KIT"
ShopItemTypeXpRestore ShopItemType = "XP_RESTORE"
ShopItemTypeDeliverableWithNoVariant ShopItemType = "DELIVERABLE_WITH_NO_VARIANT"
)
type ShopItemsParams struct {
Types []ShopItemType `graphql:"types"`
UnlockedOnly bool `graphql:"unlockedOnly"`
}