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

-- | Reports that authentication code wasn't delivered via SMS; for official mobile applications only. Works only when the current authorization state is authorizationStateWaitCode. Returns 'TD.Data.Ok.Ok'
data ReportAuthenticationCodeMissing
  = ReportAuthenticationCodeMissing
    { ReportAuthenticationCodeMissing -> Maybe Text
mobile_network_code :: Maybe T.Text -- ^ Current mobile network code
    }
  deriving (ReportAuthenticationCodeMissing
-> ReportAuthenticationCodeMissing -> Bool
(ReportAuthenticationCodeMissing
 -> ReportAuthenticationCodeMissing -> Bool)
-> (ReportAuthenticationCodeMissing
    -> ReportAuthenticationCodeMissing -> Bool)
-> Eq ReportAuthenticationCodeMissing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReportAuthenticationCodeMissing
-> ReportAuthenticationCodeMissing -> Bool
== :: ReportAuthenticationCodeMissing
-> ReportAuthenticationCodeMissing -> Bool
$c/= :: ReportAuthenticationCodeMissing
-> ReportAuthenticationCodeMissing -> Bool
/= :: ReportAuthenticationCodeMissing
-> ReportAuthenticationCodeMissing -> Bool
Eq, Int -> ReportAuthenticationCodeMissing -> ShowS
[ReportAuthenticationCodeMissing] -> ShowS
ReportAuthenticationCodeMissing -> String
(Int -> ReportAuthenticationCodeMissing -> ShowS)
-> (ReportAuthenticationCodeMissing -> String)
-> ([ReportAuthenticationCodeMissing] -> ShowS)
-> Show ReportAuthenticationCodeMissing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReportAuthenticationCodeMissing -> ShowS
showsPrec :: Int -> ReportAuthenticationCodeMissing -> ShowS
$cshow :: ReportAuthenticationCodeMissing -> String
show :: ReportAuthenticationCodeMissing -> String
$cshowList :: [ReportAuthenticationCodeMissing] -> ShowS
showList :: [ReportAuthenticationCodeMissing] -> ShowS
Show)

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

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