module TD.Query.SearchAffiliatePrograms
(SearchAffiliatePrograms(..)
, defaultSearchAffiliatePrograms
) 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 TD.Data.AffiliateProgramSortOrder as AffiliateProgramSortOrder
import qualified Data.Text as T
data SearchAffiliatePrograms
= SearchAffiliatePrograms
{ SearchAffiliatePrograms -> Maybe AffiliateType
affiliate :: Maybe AffiliateType.AffiliateType
, SearchAffiliatePrograms -> Maybe AffiliateProgramSortOrder
sort_order :: Maybe AffiliateProgramSortOrder.AffiliateProgramSortOrder
, SearchAffiliatePrograms -> Maybe Text
offset :: Maybe T.Text
, SearchAffiliatePrograms -> Maybe Int
limit :: Maybe Int
}
deriving (SearchAffiliatePrograms -> SearchAffiliatePrograms -> Bool
(SearchAffiliatePrograms -> SearchAffiliatePrograms -> Bool)
-> (SearchAffiliatePrograms -> SearchAffiliatePrograms -> Bool)
-> Eq SearchAffiliatePrograms
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchAffiliatePrograms -> SearchAffiliatePrograms -> Bool
== :: SearchAffiliatePrograms -> SearchAffiliatePrograms -> Bool
$c/= :: SearchAffiliatePrograms -> SearchAffiliatePrograms -> Bool
/= :: SearchAffiliatePrograms -> SearchAffiliatePrograms -> Bool
Eq, Int -> SearchAffiliatePrograms -> ShowS
[SearchAffiliatePrograms] -> ShowS
SearchAffiliatePrograms -> String
(Int -> SearchAffiliatePrograms -> ShowS)
-> (SearchAffiliatePrograms -> String)
-> ([SearchAffiliatePrograms] -> ShowS)
-> Show SearchAffiliatePrograms
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchAffiliatePrograms -> ShowS
showsPrec :: Int -> SearchAffiliatePrograms -> ShowS
$cshow :: SearchAffiliatePrograms -> String
show :: SearchAffiliatePrograms -> String
$cshowList :: [SearchAffiliatePrograms] -> ShowS
showList :: [SearchAffiliatePrograms] -> ShowS
Show)
instance I.ShortShow SearchAffiliatePrograms where
shortShow :: SearchAffiliatePrograms -> String
shortShow
SearchAffiliatePrograms
{ affiliate :: SearchAffiliatePrograms -> Maybe AffiliateType
affiliate = Maybe AffiliateType
affiliate_
, sort_order :: SearchAffiliatePrograms -> Maybe AffiliateProgramSortOrder
sort_order = Maybe AffiliateProgramSortOrder
sort_order_
, offset :: SearchAffiliatePrograms -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchAffiliatePrograms -> Maybe Int
limit = Maybe Int
limit_
}
= String
"SearchAffiliatePrograms"
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
"sort_order" String -> Maybe AffiliateProgramSortOrder -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe AffiliateProgramSortOrder
sort_order_
, String
"offset" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
offset_
, String
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
]
instance AT.ToJSON SearchAffiliatePrograms where
toJSON :: SearchAffiliatePrograms -> Value
toJSON
SearchAffiliatePrograms
{ affiliate :: SearchAffiliatePrograms -> Maybe AffiliateType
affiliate = Maybe AffiliateType
affiliate_
, sort_order :: SearchAffiliatePrograms -> Maybe AffiliateProgramSortOrder
sort_order = Maybe AffiliateProgramSortOrder
sort_order_
, offset :: SearchAffiliatePrograms -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchAffiliatePrograms -> Maybe Int
limit = Maybe Int
limit_
}
= [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
"searchAffiliatePrograms"
, 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
"sort_order" Key -> Maybe AffiliateProgramSortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe AffiliateProgramSortOrder
sort_order_
, Key
"offset" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
offset_
, Key
"limit" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
limit_
]
defaultSearchAffiliatePrograms :: SearchAffiliatePrograms
defaultSearchAffiliatePrograms :: SearchAffiliatePrograms
defaultSearchAffiliatePrograms =
SearchAffiliatePrograms
{ affiliate :: Maybe AffiliateType
affiliate = Maybe AffiliateType
forall a. Maybe a
Nothing
, sort_order :: Maybe AffiliateProgramSortOrder
sort_order = Maybe AffiliateProgramSortOrder
forall a. Maybe a
Nothing
, offset :: Maybe Text
offset = Maybe Text
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
}