{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Kafka.Types.StateInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StateInfo = StateInfo'
{ StateInfo -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
StateInfo -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (StateInfo -> StateInfo -> Bool
(StateInfo -> StateInfo -> Bool)
-> (StateInfo -> StateInfo -> Bool) -> Eq StateInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StateInfo -> StateInfo -> Bool
$c/= :: StateInfo -> StateInfo -> Bool
== :: StateInfo -> StateInfo -> Bool
$c== :: StateInfo -> StateInfo -> Bool
Prelude.Eq, ReadPrec [StateInfo]
ReadPrec StateInfo
Int -> ReadS StateInfo
ReadS [StateInfo]
(Int -> ReadS StateInfo)
-> ReadS [StateInfo]
-> ReadPrec StateInfo
-> ReadPrec [StateInfo]
-> Read StateInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StateInfo]
$creadListPrec :: ReadPrec [StateInfo]
readPrec :: ReadPrec StateInfo
$creadPrec :: ReadPrec StateInfo
readList :: ReadS [StateInfo]
$creadList :: ReadS [StateInfo]
readsPrec :: Int -> ReadS StateInfo
$creadsPrec :: Int -> ReadS StateInfo
Prelude.Read, Int -> StateInfo -> ShowS
[StateInfo] -> ShowS
StateInfo -> String
(Int -> StateInfo -> ShowS)
-> (StateInfo -> String)
-> ([StateInfo] -> ShowS)
-> Show StateInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StateInfo] -> ShowS
$cshowList :: [StateInfo] -> ShowS
show :: StateInfo -> String
$cshow :: StateInfo -> String
showsPrec :: Int -> StateInfo -> ShowS
$cshowsPrec :: Int -> StateInfo -> ShowS
Prelude.Show, (forall x. StateInfo -> Rep StateInfo x)
-> (forall x. Rep StateInfo x -> StateInfo) -> Generic StateInfo
forall x. Rep StateInfo x -> StateInfo
forall x. StateInfo -> Rep StateInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StateInfo x -> StateInfo
$cfrom :: forall x. StateInfo -> Rep StateInfo x
Prelude.Generic)
newStateInfo ::
StateInfo
newStateInfo :: StateInfo
newStateInfo =
StateInfo' :: Maybe Text -> Maybe Text -> StateInfo
StateInfo'
{ $sel:code:StateInfo' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:message:StateInfo' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
stateInfo_code :: Lens.Lens' StateInfo (Prelude.Maybe Prelude.Text)
stateInfo_code :: (Maybe Text -> f (Maybe Text)) -> StateInfo -> f StateInfo
stateInfo_code = (StateInfo -> Maybe Text)
-> (StateInfo -> Maybe Text -> StateInfo)
-> Lens StateInfo StateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StateInfo' {Maybe Text
code :: Maybe Text
$sel:code:StateInfo' :: StateInfo -> Maybe Text
code} -> Maybe Text
code) (\s :: StateInfo
s@StateInfo' {} Maybe Text
a -> StateInfo
s {$sel:code:StateInfo' :: Maybe Text
code = Maybe Text
a} :: StateInfo)
stateInfo_message :: Lens.Lens' StateInfo (Prelude.Maybe Prelude.Text)
stateInfo_message :: (Maybe Text -> f (Maybe Text)) -> StateInfo -> f StateInfo
stateInfo_message = (StateInfo -> Maybe Text)
-> (StateInfo -> Maybe Text -> StateInfo)
-> Lens StateInfo StateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StateInfo' {Maybe Text
message :: Maybe Text
$sel:message:StateInfo' :: StateInfo -> Maybe Text
message} -> Maybe Text
message) (\s :: StateInfo
s@StateInfo' {} Maybe Text
a -> StateInfo
s {$sel:message:StateInfo' :: Maybe Text
message = Maybe Text
a} :: StateInfo)
instance Core.FromJSON StateInfo where
parseJSON :: Value -> Parser StateInfo
parseJSON =
String -> (Object -> Parser StateInfo) -> Value -> Parser StateInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StateInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> StateInfo
StateInfo'
(Maybe Text -> Maybe Text -> StateInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> StateInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"code")
Parser (Maybe Text -> StateInfo)
-> Parser (Maybe Text) -> Parser StateInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"message")
)
instance Prelude.Hashable StateInfo
instance Prelude.NFData StateInfo