module TD.Query.DeleteTextCompositionStyle
  (DeleteTextCompositionStyle(..)
  ) 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

-- | Deletes a custom text composition style that was created by the current user. Returns 'TD.Data.Ok.Ok'
data DeleteTextCompositionStyle
  = DeleteTextCompositionStyle
    { DeleteTextCompositionStyle -> Maybe Text
name :: Maybe T.Text -- ^ Name of the style
    }
  deriving (DeleteTextCompositionStyle -> DeleteTextCompositionStyle -> Bool
(DeleteTextCompositionStyle -> DeleteTextCompositionStyle -> Bool)
-> (DeleteTextCompositionStyle
    -> DeleteTextCompositionStyle -> Bool)
-> Eq DeleteTextCompositionStyle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteTextCompositionStyle -> DeleteTextCompositionStyle -> Bool
== :: DeleteTextCompositionStyle -> DeleteTextCompositionStyle -> Bool
$c/= :: DeleteTextCompositionStyle -> DeleteTextCompositionStyle -> Bool
/= :: DeleteTextCompositionStyle -> DeleteTextCompositionStyle -> Bool
Eq, Int -> DeleteTextCompositionStyle -> ShowS
[DeleteTextCompositionStyle] -> ShowS
DeleteTextCompositionStyle -> String
(Int -> DeleteTextCompositionStyle -> ShowS)
-> (DeleteTextCompositionStyle -> String)
-> ([DeleteTextCompositionStyle] -> ShowS)
-> Show DeleteTextCompositionStyle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteTextCompositionStyle -> ShowS
showsPrec :: Int -> DeleteTextCompositionStyle -> ShowS
$cshow :: DeleteTextCompositionStyle -> String
show :: DeleteTextCompositionStyle -> String
$cshowList :: [DeleteTextCompositionStyle] -> ShowS
showList :: [DeleteTextCompositionStyle] -> ShowS
Show)

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

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