{-# 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.ConfigurationInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConfigurationInfo = ConfigurationInfo'
{
ConfigurationInfo -> Integer
revision :: Prelude.Integer,
ConfigurationInfo -> Text
arn :: Prelude.Text
}
deriving (ConfigurationInfo -> ConfigurationInfo -> Bool
(ConfigurationInfo -> ConfigurationInfo -> Bool)
-> (ConfigurationInfo -> ConfigurationInfo -> Bool)
-> Eq ConfigurationInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigurationInfo -> ConfigurationInfo -> Bool
$c/= :: ConfigurationInfo -> ConfigurationInfo -> Bool
== :: ConfigurationInfo -> ConfigurationInfo -> Bool
$c== :: ConfigurationInfo -> ConfigurationInfo -> Bool
Prelude.Eq, ReadPrec [ConfigurationInfo]
ReadPrec ConfigurationInfo
Int -> ReadS ConfigurationInfo
ReadS [ConfigurationInfo]
(Int -> ReadS ConfigurationInfo)
-> ReadS [ConfigurationInfo]
-> ReadPrec ConfigurationInfo
-> ReadPrec [ConfigurationInfo]
-> Read ConfigurationInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigurationInfo]
$creadListPrec :: ReadPrec [ConfigurationInfo]
readPrec :: ReadPrec ConfigurationInfo
$creadPrec :: ReadPrec ConfigurationInfo
readList :: ReadS [ConfigurationInfo]
$creadList :: ReadS [ConfigurationInfo]
readsPrec :: Int -> ReadS ConfigurationInfo
$creadsPrec :: Int -> ReadS ConfigurationInfo
Prelude.Read, Int -> ConfigurationInfo -> ShowS
[ConfigurationInfo] -> ShowS
ConfigurationInfo -> String
(Int -> ConfigurationInfo -> ShowS)
-> (ConfigurationInfo -> String)
-> ([ConfigurationInfo] -> ShowS)
-> Show ConfigurationInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigurationInfo] -> ShowS
$cshowList :: [ConfigurationInfo] -> ShowS
show :: ConfigurationInfo -> String
$cshow :: ConfigurationInfo -> String
showsPrec :: Int -> ConfigurationInfo -> ShowS
$cshowsPrec :: Int -> ConfigurationInfo -> ShowS
Prelude.Show, (forall x. ConfigurationInfo -> Rep ConfigurationInfo x)
-> (forall x. Rep ConfigurationInfo x -> ConfigurationInfo)
-> Generic ConfigurationInfo
forall x. Rep ConfigurationInfo x -> ConfigurationInfo
forall x. ConfigurationInfo -> Rep ConfigurationInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigurationInfo x -> ConfigurationInfo
$cfrom :: forall x. ConfigurationInfo -> Rep ConfigurationInfo x
Prelude.Generic)
newConfigurationInfo ::
Prelude.Integer ->
Prelude.Text ->
ConfigurationInfo
newConfigurationInfo :: Integer -> Text -> ConfigurationInfo
newConfigurationInfo Integer
pRevision_ Text
pArn_ =
ConfigurationInfo' :: Integer -> Text -> ConfigurationInfo
ConfigurationInfo'
{ $sel:revision:ConfigurationInfo' :: Integer
revision = Integer
pRevision_,
$sel:arn:ConfigurationInfo' :: Text
arn = Text
pArn_
}
configurationInfo_revision :: Lens.Lens' ConfigurationInfo Prelude.Integer
configurationInfo_revision :: (Integer -> f Integer) -> ConfigurationInfo -> f ConfigurationInfo
configurationInfo_revision = (ConfigurationInfo -> Integer)
-> (ConfigurationInfo -> Integer -> ConfigurationInfo)
-> Lens ConfigurationInfo ConfigurationInfo Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationInfo' {Integer
revision :: Integer
$sel:revision:ConfigurationInfo' :: ConfigurationInfo -> Integer
revision} -> Integer
revision) (\s :: ConfigurationInfo
s@ConfigurationInfo' {} Integer
a -> ConfigurationInfo
s {$sel:revision:ConfigurationInfo' :: Integer
revision = Integer
a} :: ConfigurationInfo)
configurationInfo_arn :: Lens.Lens' ConfigurationInfo Prelude.Text
configurationInfo_arn :: (Text -> f Text) -> ConfigurationInfo -> f ConfigurationInfo
configurationInfo_arn = (ConfigurationInfo -> Text)
-> (ConfigurationInfo -> Text -> ConfigurationInfo)
-> Lens ConfigurationInfo ConfigurationInfo Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationInfo' {Text
arn :: Text
$sel:arn:ConfigurationInfo' :: ConfigurationInfo -> Text
arn} -> Text
arn) (\s :: ConfigurationInfo
s@ConfigurationInfo' {} Text
a -> ConfigurationInfo
s {$sel:arn:ConfigurationInfo' :: Text
arn = Text
a} :: ConfigurationInfo)
instance Core.FromJSON ConfigurationInfo where
parseJSON :: Value -> Parser ConfigurationInfo
parseJSON =
String
-> (Object -> Parser ConfigurationInfo)
-> Value
-> Parser ConfigurationInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ConfigurationInfo"
( \Object
x ->
Integer -> Text -> ConfigurationInfo
ConfigurationInfo'
(Integer -> Text -> ConfigurationInfo)
-> Parser Integer -> Parser (Text -> ConfigurationInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"revision") Parser (Text -> ConfigurationInfo)
-> Parser Text -> Parser ConfigurationInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
)
instance Prelude.Hashable ConfigurationInfo
instance Prelude.NFData ConfigurationInfo
instance Core.ToJSON ConfigurationInfo where
toJSON :: ConfigurationInfo -> Value
toJSON ConfigurationInfo' {Integer
Text
arn :: Text
revision :: Integer
$sel:arn:ConfigurationInfo' :: ConfigurationInfo -> Text
$sel:revision:ConfigurationInfo' :: ConfigurationInfo -> Integer
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"revision" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Integer
revision),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
]
)