module TD.Query.GetStickerOutline
  (GetStickerOutline(..)
  , defaultGetStickerOutline
  ) where

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

-- | Returns outline of a sticker; this is an offline request. Returns a 404 error if the outline isn't known. Returns 'TD.Data.Outline.Outline'
data GetStickerOutline
  = GetStickerOutline
    { GetStickerOutline -> Maybe Int
sticker_file_id                    :: Maybe Int  -- ^ File identifier of the sticker
    , GetStickerOutline -> Maybe Bool
for_animated_emoji                 :: Maybe Bool -- ^ Pass true to get the outline scaled for animated emoji
    , GetStickerOutline -> Maybe Bool
for_clicked_animated_emoji_message :: Maybe Bool -- ^ Pass true to get the outline scaled for clicked animated emoji message
    }
  deriving (GetStickerOutline -> GetStickerOutline -> Bool
(GetStickerOutline -> GetStickerOutline -> Bool)
-> (GetStickerOutline -> GetStickerOutline -> Bool)
-> Eq GetStickerOutline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetStickerOutline -> GetStickerOutline -> Bool
== :: GetStickerOutline -> GetStickerOutline -> Bool
$c/= :: GetStickerOutline -> GetStickerOutline -> Bool
/= :: GetStickerOutline -> GetStickerOutline -> Bool
Eq, Int -> GetStickerOutline -> ShowS
[GetStickerOutline] -> ShowS
GetStickerOutline -> String
(Int -> GetStickerOutline -> ShowS)
-> (GetStickerOutline -> String)
-> ([GetStickerOutline] -> ShowS)
-> Show GetStickerOutline
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetStickerOutline -> ShowS
showsPrec :: Int -> GetStickerOutline -> ShowS
$cshow :: GetStickerOutline -> String
show :: GetStickerOutline -> String
$cshowList :: [GetStickerOutline] -> ShowS
showList :: [GetStickerOutline] -> ShowS
Show)

instance I.ShortShow GetStickerOutline where
  shortShow :: GetStickerOutline -> String
shortShow
    GetStickerOutline
      { sticker_file_id :: GetStickerOutline -> Maybe Int
sticker_file_id                    = Maybe Int
sticker_file_id_
      , for_animated_emoji :: GetStickerOutline -> Maybe Bool
for_animated_emoji                 = Maybe Bool
for_animated_emoji_
      , for_clicked_animated_emoji_message :: GetStickerOutline -> Maybe Bool
for_clicked_animated_emoji_message = Maybe Bool
for_clicked_animated_emoji_message_
      }
        = String
"GetStickerOutline"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"sticker_file_id"                    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
sticker_file_id_
          , String
"for_animated_emoji"                 String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
for_animated_emoji_
          , String
"for_clicked_animated_emoji_message" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
for_clicked_animated_emoji_message_
          ]

instance AT.ToJSON GetStickerOutline where
  toJSON :: GetStickerOutline -> Value
toJSON
    GetStickerOutline
      { sticker_file_id :: GetStickerOutline -> Maybe Int
sticker_file_id                    = Maybe Int
sticker_file_id_
      , for_animated_emoji :: GetStickerOutline -> Maybe Bool
for_animated_emoji                 = Maybe Bool
for_animated_emoji_
      , for_clicked_animated_emoji_message :: GetStickerOutline -> Maybe Bool
for_clicked_animated_emoji_message = Maybe Bool
for_clicked_animated_emoji_message_
      }
        = [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
"getStickerOutline"
          , Key
"sticker_file_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
sticker_file_id_
          , Key
"for_animated_emoji"                 Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
for_animated_emoji_
          , Key
"for_clicked_animated_emoji_message" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
for_clicked_animated_emoji_message_
          ]

defaultGetStickerOutline :: GetStickerOutline
defaultGetStickerOutline :: GetStickerOutline
defaultGetStickerOutline =
  GetStickerOutline
    { sticker_file_id :: Maybe Int
sticker_file_id                    = Maybe Int
forall a. Maybe a
Nothing
    , for_animated_emoji :: Maybe Bool
for_animated_emoji                 = Maybe Bool
forall a. Maybe a
Nothing
    , for_clicked_animated_emoji_message :: Maybe Bool
for_clicked_animated_emoji_message = Maybe Bool
forall a. Maybe a
Nothing
    }