module TD.Query.GetRecentlyVisitedTMeUrls
  (GetRecentlyVisitedTMeUrls(..)
  ) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T

-- | Returns t.me URLs recently visited by a newly registered user. Returns 'TD.Data.TMeUrls.TMeUrls'
data GetRecentlyVisitedTMeUrls
  = GetRecentlyVisitedTMeUrls
    { GetRecentlyVisitedTMeUrls -> Maybe Text
referrer :: Maybe T.Text -- ^ Google Play referrer to identify the user
    }
  deriving (GetRecentlyVisitedTMeUrls -> GetRecentlyVisitedTMeUrls -> Bool
(GetRecentlyVisitedTMeUrls -> GetRecentlyVisitedTMeUrls -> Bool)
-> (GetRecentlyVisitedTMeUrls -> GetRecentlyVisitedTMeUrls -> Bool)
-> Eq GetRecentlyVisitedTMeUrls
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetRecentlyVisitedTMeUrls -> GetRecentlyVisitedTMeUrls -> Bool
== :: GetRecentlyVisitedTMeUrls -> GetRecentlyVisitedTMeUrls -> Bool
$c/= :: GetRecentlyVisitedTMeUrls -> GetRecentlyVisitedTMeUrls -> Bool
/= :: GetRecentlyVisitedTMeUrls -> GetRecentlyVisitedTMeUrls -> Bool
Eq, Int -> GetRecentlyVisitedTMeUrls -> ShowS
[GetRecentlyVisitedTMeUrls] -> ShowS
GetRecentlyVisitedTMeUrls -> String
(Int -> GetRecentlyVisitedTMeUrls -> ShowS)
-> (GetRecentlyVisitedTMeUrls -> String)
-> ([GetRecentlyVisitedTMeUrls] -> ShowS)
-> Show GetRecentlyVisitedTMeUrls
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetRecentlyVisitedTMeUrls -> ShowS
showsPrec :: Int -> GetRecentlyVisitedTMeUrls -> ShowS
$cshow :: GetRecentlyVisitedTMeUrls -> String
show :: GetRecentlyVisitedTMeUrls -> String
$cshowList :: [GetRecentlyVisitedTMeUrls] -> ShowS
showList :: [GetRecentlyVisitedTMeUrls] -> ShowS
Show)

instance I.ShortShow GetRecentlyVisitedTMeUrls where
  shortShow :: GetRecentlyVisitedTMeUrls -> String
shortShow
    GetRecentlyVisitedTMeUrls
      { referrer :: GetRecentlyVisitedTMeUrls -> Maybe Text
referrer = Maybe Text
referrer_
      }
        = String
"GetRecentlyVisitedTMeUrls"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"referrer" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
referrer_
          ]

instance AT.ToJSON GetRecentlyVisitedTMeUrls where
  toJSON :: GetRecentlyVisitedTMeUrls -> Value
toJSON
    GetRecentlyVisitedTMeUrls
      { referrer :: GetRecentlyVisitedTMeUrls -> Maybe Text
referrer = Maybe Text
referrer_
      }
        = [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
"getRecentlyVisitedTMeUrls"
          , Key
"referrer" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
referrer_
          ]