module TD.Query.GetInlineQueryResults
(GetInlineQueryResults(..)
, defaultGetInlineQueryResults
) 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.Location as Location
import qualified Data.Text as T
data GetInlineQueryResults
= GetInlineQueryResults
{ GetInlineQueryResults -> Maybe Int
bot_user_id :: Maybe Int
, GetInlineQueryResults -> Maybe Int
chat_id :: Maybe Int
, GetInlineQueryResults -> Maybe Location
user_location :: Maybe Location.Location
, GetInlineQueryResults -> Maybe Text
query :: Maybe T.Text
, GetInlineQueryResults -> Maybe Text
offset :: Maybe T.Text
}
deriving (GetInlineQueryResults -> GetInlineQueryResults -> Bool
(GetInlineQueryResults -> GetInlineQueryResults -> Bool)
-> (GetInlineQueryResults -> GetInlineQueryResults -> Bool)
-> Eq GetInlineQueryResults
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetInlineQueryResults -> GetInlineQueryResults -> Bool
== :: GetInlineQueryResults -> GetInlineQueryResults -> Bool
$c/= :: GetInlineQueryResults -> GetInlineQueryResults -> Bool
/= :: GetInlineQueryResults -> GetInlineQueryResults -> Bool
Eq, Int -> GetInlineQueryResults -> ShowS
[GetInlineQueryResults] -> ShowS
GetInlineQueryResults -> String
(Int -> GetInlineQueryResults -> ShowS)
-> (GetInlineQueryResults -> String)
-> ([GetInlineQueryResults] -> ShowS)
-> Show GetInlineQueryResults
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetInlineQueryResults -> ShowS
showsPrec :: Int -> GetInlineQueryResults -> ShowS
$cshow :: GetInlineQueryResults -> String
show :: GetInlineQueryResults -> String
$cshowList :: [GetInlineQueryResults] -> ShowS
showList :: [GetInlineQueryResults] -> ShowS
Show)
instance I.ShortShow GetInlineQueryResults where
shortShow :: GetInlineQueryResults -> String
shortShow
GetInlineQueryResults
{ bot_user_id :: GetInlineQueryResults -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, chat_id :: GetInlineQueryResults -> Maybe Int
chat_id = Maybe Int
chat_id_
, user_location :: GetInlineQueryResults -> Maybe Location
user_location = Maybe Location
user_location_
, query :: GetInlineQueryResults -> Maybe Text
query = Maybe Text
query_
, offset :: GetInlineQueryResults -> Maybe Text
offset = Maybe Text
offset_
}
= String
"GetInlineQueryResults"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
bot_user_id_
, String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"user_location" String -> Maybe Location -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Location
user_location_
, String
"query" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
query_
, String
"offset" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
offset_
]
instance AT.ToJSON GetInlineQueryResults where
toJSON :: GetInlineQueryResults -> Value
toJSON
GetInlineQueryResults
{ bot_user_id :: GetInlineQueryResults -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, chat_id :: GetInlineQueryResults -> Maybe Int
chat_id = Maybe Int
chat_id_
, user_location :: GetInlineQueryResults -> Maybe Location
user_location = Maybe Location
user_location_
, query :: GetInlineQueryResults -> Maybe Text
query = Maybe Text
query_
, offset :: GetInlineQueryResults -> Maybe Text
offset = Maybe Text
offset_
}
= [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
"getInlineQueryResults"
, Key
"bot_user_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
bot_user_id_
, Key
"chat_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
chat_id_
, Key
"user_location" Key -> Maybe Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Location
user_location_
, Key
"query" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
query_
, 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_
]
defaultGetInlineQueryResults :: GetInlineQueryResults
defaultGetInlineQueryResults :: GetInlineQueryResults
defaultGetInlineQueryResults =
GetInlineQueryResults
{ bot_user_id :: Maybe Int
bot_user_id = Maybe Int
forall a. Maybe a
Nothing
, chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, user_location :: Maybe Location
user_location = Maybe Location
forall a. Maybe a
Nothing
, query :: Maybe Text
query = Maybe Text
forall a. Maybe a
Nothing
, offset :: Maybe Text
offset = Maybe Text
forall a. Maybe a
Nothing
}