module TD.Query.SetStickerEmojis
  (SetStickerEmojis(..)
  , defaultSetStickerEmojis
  ) 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.InputFile as InputFile
import qualified Data.Text as T

-- | Changes the list of emojis corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user. Returns 'TD.Data.Ok.Ok'
data SetStickerEmojis
  = SetStickerEmojis
    { SetStickerEmojis -> Maybe InputFile
sticker :: Maybe InputFile.InputFile -- ^ Sticker
    , SetStickerEmojis -> Maybe Text
emojis  :: Maybe T.Text              -- ^ New string with 1-20 emoji corresponding to the sticker
    }
  deriving (SetStickerEmojis -> SetStickerEmojis -> Bool
(SetStickerEmojis -> SetStickerEmojis -> Bool)
-> (SetStickerEmojis -> SetStickerEmojis -> Bool)
-> Eq SetStickerEmojis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetStickerEmojis -> SetStickerEmojis -> Bool
== :: SetStickerEmojis -> SetStickerEmojis -> Bool
$c/= :: SetStickerEmojis -> SetStickerEmojis -> Bool
/= :: SetStickerEmojis -> SetStickerEmojis -> Bool
Eq, Int -> SetStickerEmojis -> ShowS
[SetStickerEmojis] -> ShowS
SetStickerEmojis -> String
(Int -> SetStickerEmojis -> ShowS)
-> (SetStickerEmojis -> String)
-> ([SetStickerEmojis] -> ShowS)
-> Show SetStickerEmojis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetStickerEmojis -> ShowS
showsPrec :: Int -> SetStickerEmojis -> ShowS
$cshow :: SetStickerEmojis -> String
show :: SetStickerEmojis -> String
$cshowList :: [SetStickerEmojis] -> ShowS
showList :: [SetStickerEmojis] -> ShowS
Show)

instance I.ShortShow SetStickerEmojis where
  shortShow :: SetStickerEmojis -> String
shortShow
    SetStickerEmojis
      { sticker :: SetStickerEmojis -> Maybe InputFile
sticker = Maybe InputFile
sticker_
      , emojis :: SetStickerEmojis -> Maybe Text
emojis  = Maybe Text
emojis_
      }
        = String
"SetStickerEmojis"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"sticker" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
sticker_
          , String
"emojis"  String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
emojis_
          ]

instance AT.ToJSON SetStickerEmojis where
  toJSON :: SetStickerEmojis -> Value
toJSON
    SetStickerEmojis
      { sticker :: SetStickerEmojis -> Maybe InputFile
sticker = Maybe InputFile
sticker_
      , emojis :: SetStickerEmojis -> Maybe Text
emojis  = Maybe Text
emojis_
      }
        = [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
"setStickerEmojis"
          , Key
"sticker" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
sticker_
          , Key
"emojis"  Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
emojis_
          ]

defaultSetStickerEmojis :: SetStickerEmojis
defaultSetStickerEmojis :: SetStickerEmojis
defaultSetStickerEmojis =
  SetStickerEmojis
    { sticker :: Maybe InputFile
sticker = Maybe InputFile
forall a. Maybe a
Nothing
    , emojis :: Maybe Text
emojis  = Maybe Text
forall a. Maybe a
Nothing
    }