module TD.Query.EditCustomLanguagePackInfo
  (EditCustomLanguagePackInfo(..)
  ) 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.LanguagePackInfo as LanguagePackInfo

-- | Edits information about a custom local language pack in the current localization target. Can be called before authorization. Returns 'TD.Data.Ok.Ok'
data EditCustomLanguagePackInfo
  = EditCustomLanguagePackInfo
    { EditCustomLanguagePackInfo -> Maybe LanguagePackInfo
info :: Maybe LanguagePackInfo.LanguagePackInfo -- ^ New information about the custom local language pack
    }
  deriving (EditCustomLanguagePackInfo -> EditCustomLanguagePackInfo -> Bool
(EditCustomLanguagePackInfo -> EditCustomLanguagePackInfo -> Bool)
-> (EditCustomLanguagePackInfo
    -> EditCustomLanguagePackInfo -> Bool)
-> Eq EditCustomLanguagePackInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EditCustomLanguagePackInfo -> EditCustomLanguagePackInfo -> Bool
== :: EditCustomLanguagePackInfo -> EditCustomLanguagePackInfo -> Bool
$c/= :: EditCustomLanguagePackInfo -> EditCustomLanguagePackInfo -> Bool
/= :: EditCustomLanguagePackInfo -> EditCustomLanguagePackInfo -> Bool
Eq, Int -> EditCustomLanguagePackInfo -> ShowS
[EditCustomLanguagePackInfo] -> ShowS
EditCustomLanguagePackInfo -> String
(Int -> EditCustomLanguagePackInfo -> ShowS)
-> (EditCustomLanguagePackInfo -> String)
-> ([EditCustomLanguagePackInfo] -> ShowS)
-> Show EditCustomLanguagePackInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EditCustomLanguagePackInfo -> ShowS
showsPrec :: Int -> EditCustomLanguagePackInfo -> ShowS
$cshow :: EditCustomLanguagePackInfo -> String
show :: EditCustomLanguagePackInfo -> String
$cshowList :: [EditCustomLanguagePackInfo] -> ShowS
showList :: [EditCustomLanguagePackInfo] -> ShowS
Show)

instance I.ShortShow EditCustomLanguagePackInfo where
  shortShow :: EditCustomLanguagePackInfo -> String
shortShow
    EditCustomLanguagePackInfo
      { info :: EditCustomLanguagePackInfo -> Maybe LanguagePackInfo
info = Maybe LanguagePackInfo
info_
      }
        = String
"EditCustomLanguagePackInfo"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"info" String -> Maybe LanguagePackInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe LanguagePackInfo
info_
          ]

instance AT.ToJSON EditCustomLanguagePackInfo where
  toJSON :: EditCustomLanguagePackInfo -> Value
toJSON
    EditCustomLanguagePackInfo
      { info :: EditCustomLanguagePackInfo -> Maybe LanguagePackInfo
info = Maybe LanguagePackInfo
info_
      }
        = [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
"editCustomLanguagePackInfo"
          , Key
"info"  Key -> Maybe LanguagePackInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe LanguagePackInfo
info_
          ]