module TD.Query.GetStickerOutlineSvgPath
  (GetStickerOutlineSvgPath(..)
  , defaultGetStickerOutlineSvgPath
  ) 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 as an SVG path. This is an offline method. Returns an empty string if the outline isn't known. Returns 'TD.Data.Text.Text'
data GetStickerOutlineSvgPath
  = GetStickerOutlineSvgPath
    { GetStickerOutlineSvgPath -> Maybe Int
sticker_file_id                    :: Maybe Int  -- ^ File identifier of the sticker
    , GetStickerOutlineSvgPath -> Maybe Bool
for_animated_emoji                 :: Maybe Bool -- ^ Pass true to get the outline scaled for animated emoji
    , GetStickerOutlineSvgPath -> Maybe Bool
for_clicked_animated_emoji_message :: Maybe Bool -- ^ Pass true to get the outline scaled for clicked animated emoji message
    }
  deriving (GetStickerOutlineSvgPath -> GetStickerOutlineSvgPath -> Bool
(GetStickerOutlineSvgPath -> GetStickerOutlineSvgPath -> Bool)
-> (GetStickerOutlineSvgPath -> GetStickerOutlineSvgPath -> Bool)
-> Eq GetStickerOutlineSvgPath
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetStickerOutlineSvgPath -> GetStickerOutlineSvgPath -> Bool
== :: GetStickerOutlineSvgPath -> GetStickerOutlineSvgPath -> Bool
$c/= :: GetStickerOutlineSvgPath -> GetStickerOutlineSvgPath -> Bool
/= :: GetStickerOutlineSvgPath -> GetStickerOutlineSvgPath -> Bool
Eq, Int -> GetStickerOutlineSvgPath -> ShowS
[GetStickerOutlineSvgPath] -> ShowS
GetStickerOutlineSvgPath -> String
(Int -> GetStickerOutlineSvgPath -> ShowS)
-> (GetStickerOutlineSvgPath -> String)
-> ([GetStickerOutlineSvgPath] -> ShowS)
-> Show GetStickerOutlineSvgPath
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetStickerOutlineSvgPath -> ShowS
showsPrec :: Int -> GetStickerOutlineSvgPath -> ShowS
$cshow :: GetStickerOutlineSvgPath -> String
show :: GetStickerOutlineSvgPath -> String
$cshowList :: [GetStickerOutlineSvgPath] -> ShowS
showList :: [GetStickerOutlineSvgPath] -> ShowS
Show)

instance I.ShortShow GetStickerOutlineSvgPath where
  shortShow :: GetStickerOutlineSvgPath -> String
shortShow
    GetStickerOutlineSvgPath
      { sticker_file_id :: GetStickerOutlineSvgPath -> Maybe Int
sticker_file_id                    = Maybe Int
sticker_file_id_
      , for_animated_emoji :: GetStickerOutlineSvgPath -> Maybe Bool
for_animated_emoji                 = Maybe Bool
for_animated_emoji_
      , for_clicked_animated_emoji_message :: GetStickerOutlineSvgPath -> Maybe Bool
for_clicked_animated_emoji_message = Maybe Bool
for_clicked_animated_emoji_message_
      }
        = String
"GetStickerOutlineSvgPath"
          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 GetStickerOutlineSvgPath where
  toJSON :: GetStickerOutlineSvgPath -> Value
toJSON
    GetStickerOutlineSvgPath
      { sticker_file_id :: GetStickerOutlineSvgPath -> Maybe Int
sticker_file_id                    = Maybe Int
sticker_file_id_
      , for_animated_emoji :: GetStickerOutlineSvgPath -> Maybe Bool
for_animated_emoji                 = Maybe Bool
for_animated_emoji_
      , for_clicked_animated_emoji_message :: GetStickerOutlineSvgPath -> 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
"getStickerOutlineSvgPath"
          , 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_
          ]

defaultGetStickerOutlineSvgPath :: GetStickerOutlineSvgPath
defaultGetStickerOutlineSvgPath :: GetStickerOutlineSvgPath
defaultGetStickerOutlineSvgPath =
  GetStickerOutlineSvgPath
    { 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
    }