module TD.Query.DisconnectAffiliateProgram
(DisconnectAffiliateProgram(..)
, defaultDisconnectAffiliateProgram
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.AffiliateType as AffiliateType
import qualified Data.Text as T
data DisconnectAffiliateProgram
= DisconnectAffiliateProgram
{ DisconnectAffiliateProgram -> Maybe AffiliateType
affiliate :: Maybe AffiliateType.AffiliateType
, DisconnectAffiliateProgram -> Maybe Text
url :: Maybe T.Text
}
deriving (DisconnectAffiliateProgram -> DisconnectAffiliateProgram -> Bool
(DisconnectAffiliateProgram -> DisconnectAffiliateProgram -> Bool)
-> (DisconnectAffiliateProgram
-> DisconnectAffiliateProgram -> Bool)
-> Eq DisconnectAffiliateProgram
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DisconnectAffiliateProgram -> DisconnectAffiliateProgram -> Bool
== :: DisconnectAffiliateProgram -> DisconnectAffiliateProgram -> Bool
$c/= :: DisconnectAffiliateProgram -> DisconnectAffiliateProgram -> Bool
/= :: DisconnectAffiliateProgram -> DisconnectAffiliateProgram -> Bool
Eq, Int -> DisconnectAffiliateProgram -> ShowS
[DisconnectAffiliateProgram] -> ShowS
DisconnectAffiliateProgram -> String
(Int -> DisconnectAffiliateProgram -> ShowS)
-> (DisconnectAffiliateProgram -> String)
-> ([DisconnectAffiliateProgram] -> ShowS)
-> Show DisconnectAffiliateProgram
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DisconnectAffiliateProgram -> ShowS
showsPrec :: Int -> DisconnectAffiliateProgram -> ShowS
$cshow :: DisconnectAffiliateProgram -> String
show :: DisconnectAffiliateProgram -> String
$cshowList :: [DisconnectAffiliateProgram] -> ShowS
showList :: [DisconnectAffiliateProgram] -> ShowS
Show)
instance I.ShortShow DisconnectAffiliateProgram where
shortShow :: DisconnectAffiliateProgram -> String
shortShow
DisconnectAffiliateProgram
{ affiliate :: DisconnectAffiliateProgram -> Maybe AffiliateType
affiliate = Maybe AffiliateType
affiliate_
, url :: DisconnectAffiliateProgram -> Maybe Text
url = Maybe Text
url_
}
= String
"DisconnectAffiliateProgram"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"affiliate" String -> Maybe AffiliateType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe AffiliateType
affiliate_
, String
"url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
]
instance AT.ToJSON DisconnectAffiliateProgram where
toJSON :: DisconnectAffiliateProgram -> Value
toJSON
DisconnectAffiliateProgram
{ affiliate :: DisconnectAffiliateProgram -> Maybe AffiliateType
affiliate = Maybe AffiliateType
affiliate_
, url :: DisconnectAffiliateProgram -> Maybe Text
url = Maybe Text
url_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"disconnectAffiliateProgram"
, Key
"affiliate" Key -> Maybe AffiliateType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe AffiliateType
affiliate_
, Key
"url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
]
defaultDisconnectAffiliateProgram :: DisconnectAffiliateProgram
defaultDisconnectAffiliateProgram :: DisconnectAffiliateProgram
defaultDisconnectAffiliateProgram =
DisconnectAffiliateProgram
{ affiliate :: Maybe AffiliateType
affiliate = Maybe AffiliateType
forall a. Maybe a
Nothing
, url :: Maybe Text
url = Maybe Text
forall a. Maybe a
Nothing
}