{-# 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.KafkaVersion where
import qualified Amazonka.Core as Core
import Amazonka.Kafka.Types.KafkaVersionStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data KafkaVersion = KafkaVersion'
{ KafkaVersion -> Maybe KafkaVersionStatus
status :: Prelude.Maybe KafkaVersionStatus,
KafkaVersion -> Maybe Text
version :: Prelude.Maybe Prelude.Text
}
deriving (KafkaVersion -> KafkaVersion -> Bool
(KafkaVersion -> KafkaVersion -> Bool)
-> (KafkaVersion -> KafkaVersion -> Bool) -> Eq KafkaVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KafkaVersion -> KafkaVersion -> Bool
$c/= :: KafkaVersion -> KafkaVersion -> Bool
== :: KafkaVersion -> KafkaVersion -> Bool
$c== :: KafkaVersion -> KafkaVersion -> Bool
Prelude.Eq, ReadPrec [KafkaVersion]
ReadPrec KafkaVersion
Int -> ReadS KafkaVersion
ReadS [KafkaVersion]
(Int -> ReadS KafkaVersion)
-> ReadS [KafkaVersion]
-> ReadPrec KafkaVersion
-> ReadPrec [KafkaVersion]
-> Read KafkaVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KafkaVersion]
$creadListPrec :: ReadPrec [KafkaVersion]
readPrec :: ReadPrec KafkaVersion
$creadPrec :: ReadPrec KafkaVersion
readList :: ReadS [KafkaVersion]
$creadList :: ReadS [KafkaVersion]
readsPrec :: Int -> ReadS KafkaVersion
$creadsPrec :: Int -> ReadS KafkaVersion
Prelude.Read, Int -> KafkaVersion -> ShowS
[KafkaVersion] -> ShowS
KafkaVersion -> String
(Int -> KafkaVersion -> ShowS)
-> (KafkaVersion -> String)
-> ([KafkaVersion] -> ShowS)
-> Show KafkaVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KafkaVersion] -> ShowS
$cshowList :: [KafkaVersion] -> ShowS
show :: KafkaVersion -> String
$cshow :: KafkaVersion -> String
showsPrec :: Int -> KafkaVersion -> ShowS
$cshowsPrec :: Int -> KafkaVersion -> ShowS
Prelude.Show, (forall x. KafkaVersion -> Rep KafkaVersion x)
-> (forall x. Rep KafkaVersion x -> KafkaVersion)
-> Generic KafkaVersion
forall x. Rep KafkaVersion x -> KafkaVersion
forall x. KafkaVersion -> Rep KafkaVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KafkaVersion x -> KafkaVersion
$cfrom :: forall x. KafkaVersion -> Rep KafkaVersion x
Prelude.Generic)
newKafkaVersion ::
KafkaVersion
newKafkaVersion :: KafkaVersion
newKafkaVersion =
KafkaVersion' :: Maybe KafkaVersionStatus -> Maybe Text -> KafkaVersion
KafkaVersion'
{ $sel:status:KafkaVersion' :: Maybe KafkaVersionStatus
status = Maybe KafkaVersionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:version:KafkaVersion' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
kafkaVersion_status :: Lens.Lens' KafkaVersion (Prelude.Maybe KafkaVersionStatus)
kafkaVersion_status :: (Maybe KafkaVersionStatus -> f (Maybe KafkaVersionStatus))
-> KafkaVersion -> f KafkaVersion
kafkaVersion_status = (KafkaVersion -> Maybe KafkaVersionStatus)
-> (KafkaVersion -> Maybe KafkaVersionStatus -> KafkaVersion)
-> Lens
KafkaVersion
KafkaVersion
(Maybe KafkaVersionStatus)
(Maybe KafkaVersionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KafkaVersion' {Maybe KafkaVersionStatus
status :: Maybe KafkaVersionStatus
$sel:status:KafkaVersion' :: KafkaVersion -> Maybe KafkaVersionStatus
status} -> Maybe KafkaVersionStatus
status) (\s :: KafkaVersion
s@KafkaVersion' {} Maybe KafkaVersionStatus
a -> KafkaVersion
s {$sel:status:KafkaVersion' :: Maybe KafkaVersionStatus
status = Maybe KafkaVersionStatus
a} :: KafkaVersion)
kafkaVersion_version :: Lens.Lens' KafkaVersion (Prelude.Maybe Prelude.Text)
kafkaVersion_version :: (Maybe Text -> f (Maybe Text)) -> KafkaVersion -> f KafkaVersion
kafkaVersion_version = (KafkaVersion -> Maybe Text)
-> (KafkaVersion -> Maybe Text -> KafkaVersion)
-> Lens KafkaVersion KafkaVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KafkaVersion' {Maybe Text
version :: Maybe Text
$sel:version:KafkaVersion' :: KafkaVersion -> Maybe Text
version} -> Maybe Text
version) (\s :: KafkaVersion
s@KafkaVersion' {} Maybe Text
a -> KafkaVersion
s {$sel:version:KafkaVersion' :: Maybe Text
version = Maybe Text
a} :: KafkaVersion)
instance Core.FromJSON KafkaVersion where
parseJSON :: Value -> Parser KafkaVersion
parseJSON =
String
-> (Object -> Parser KafkaVersion) -> Value -> Parser KafkaVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"KafkaVersion"
( \Object
x ->
Maybe KafkaVersionStatus -> Maybe Text -> KafkaVersion
KafkaVersion'
(Maybe KafkaVersionStatus -> Maybe Text -> KafkaVersion)
-> Parser (Maybe KafkaVersionStatus)
-> Parser (Maybe Text -> KafkaVersion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe KafkaVersionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser (Maybe Text -> KafkaVersion)
-> Parser (Maybe Text) -> Parser KafkaVersion
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
"version")
)
instance Prelude.Hashable KafkaVersion
instance Prelude.NFData KafkaVersion