module TD.Query.DisableTonWalletBackupWithProof
  (DisableTonWalletBackupWithProof(..)
  ) 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.TonWalletOwnershipProof as TonWalletOwnershipProof

-- | Disables backup of the TON wallet of the user using proof of wallet ownership instead of the password. Works only if tonWalletState.is_backup_enabled is true. Returns 'TD.Data.Ok.Ok'
data DisableTonWalletBackupWithProof
  = DisableTonWalletBackupWithProof
    { DisableTonWalletBackupWithProof -> Maybe TonWalletOwnershipProof
proof :: Maybe TonWalletOwnershipProof.TonWalletOwnershipProof -- ^ Proof of the TON wallet ownership; use getTonWalletOwnershipProofChallenge to get a challenge for the proof
    }
  deriving (DisableTonWalletBackupWithProof
-> DisableTonWalletBackupWithProof -> Bool
(DisableTonWalletBackupWithProof
 -> DisableTonWalletBackupWithProof -> Bool)
-> (DisableTonWalletBackupWithProof
    -> DisableTonWalletBackupWithProof -> Bool)
-> Eq DisableTonWalletBackupWithProof
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DisableTonWalletBackupWithProof
-> DisableTonWalletBackupWithProof -> Bool
== :: DisableTonWalletBackupWithProof
-> DisableTonWalletBackupWithProof -> Bool
$c/= :: DisableTonWalletBackupWithProof
-> DisableTonWalletBackupWithProof -> Bool
/= :: DisableTonWalletBackupWithProof
-> DisableTonWalletBackupWithProof -> Bool
Eq, Int -> DisableTonWalletBackupWithProof -> ShowS
[DisableTonWalletBackupWithProof] -> ShowS
DisableTonWalletBackupWithProof -> String
(Int -> DisableTonWalletBackupWithProof -> ShowS)
-> (DisableTonWalletBackupWithProof -> String)
-> ([DisableTonWalletBackupWithProof] -> ShowS)
-> Show DisableTonWalletBackupWithProof
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DisableTonWalletBackupWithProof -> ShowS
showsPrec :: Int -> DisableTonWalletBackupWithProof -> ShowS
$cshow :: DisableTonWalletBackupWithProof -> String
show :: DisableTonWalletBackupWithProof -> String
$cshowList :: [DisableTonWalletBackupWithProof] -> ShowS
showList :: [DisableTonWalletBackupWithProof] -> ShowS
Show)

instance I.ShortShow DisableTonWalletBackupWithProof where
  shortShow :: DisableTonWalletBackupWithProof -> String
shortShow
    DisableTonWalletBackupWithProof
      { proof :: DisableTonWalletBackupWithProof -> Maybe TonWalletOwnershipProof
proof = Maybe TonWalletOwnershipProof
proof_
      }
        = String
"DisableTonWalletBackupWithProof"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"proof" String -> Maybe TonWalletOwnershipProof -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe TonWalletOwnershipProof
proof_
          ]

instance AT.ToJSON DisableTonWalletBackupWithProof where
  toJSON :: DisableTonWalletBackupWithProof -> Value
toJSON
    DisableTonWalletBackupWithProof
      { proof :: DisableTonWalletBackupWithProof -> Maybe TonWalletOwnershipProof
proof = Maybe TonWalletOwnershipProof
proof_
      }
        = [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
"disableTonWalletBackupWithProof"
          , Key
"proof" Key -> Maybe TonWalletOwnershipProof -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe TonWalletOwnershipProof
proof_
          ]