module Paddle.Client.SubscriptionUsersUpdateResponse where

import Data.Aeson (FromJSON, parseJSON, genericParseJSON)
import Protolude
import Prelude ()
import Paddle.FieldModifier (customJSONOptions)

data SubscriptionUsersUpdateResponse = SubscriptionUsersUpdateResponse
  { SubscriptionUsersUpdateResponse -> Integer
subscriptionId :: Integer
  , SubscriptionUsersUpdateResponse -> Integer
planId :: Integer
  , SubscriptionUsersUpdateResponse -> Integer
userId :: Integer
  -- TODO: nextPayment
  } deriving (Int -> SubscriptionUsersUpdateResponse -> ShowS
[SubscriptionUsersUpdateResponse] -> ShowS
SubscriptionUsersUpdateResponse -> String
(Int -> SubscriptionUsersUpdateResponse -> ShowS)
-> (SubscriptionUsersUpdateResponse -> String)
-> ([SubscriptionUsersUpdateResponse] -> ShowS)
-> Show SubscriptionUsersUpdateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubscriptionUsersUpdateResponse] -> ShowS
$cshowList :: [SubscriptionUsersUpdateResponse] -> ShowS
show :: SubscriptionUsersUpdateResponse -> String
$cshow :: SubscriptionUsersUpdateResponse -> String
showsPrec :: Int -> SubscriptionUsersUpdateResponse -> ShowS
$cshowsPrec :: Int -> SubscriptionUsersUpdateResponse -> ShowS
Show, (forall x.
 SubscriptionUsersUpdateResponse
 -> Rep SubscriptionUsersUpdateResponse x)
-> (forall x.
    Rep SubscriptionUsersUpdateResponse x
    -> SubscriptionUsersUpdateResponse)
-> Generic SubscriptionUsersUpdateResponse
forall x.
Rep SubscriptionUsersUpdateResponse x
-> SubscriptionUsersUpdateResponse
forall x.
SubscriptionUsersUpdateResponse
-> Rep SubscriptionUsersUpdateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SubscriptionUsersUpdateResponse x
-> SubscriptionUsersUpdateResponse
$cfrom :: forall x.
SubscriptionUsersUpdateResponse
-> Rep SubscriptionUsersUpdateResponse x
Generic)

instance FromJSON SubscriptionUsersUpdateResponse where
  parseJSON :: Value -> Parser SubscriptionUsersUpdateResponse
parseJSON = Options -> Value -> Parser SubscriptionUsersUpdateResponse
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
customJSONOptions