{-# 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.CompatibleKafkaVersion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CompatibleKafkaVersion = CompatibleKafkaVersion'
{
CompatibleKafkaVersion -> Maybe Text
sourceVersion :: Prelude.Maybe Prelude.Text,
CompatibleKafkaVersion -> Maybe [Text]
targetVersions :: Prelude.Maybe [Prelude.Text]
}
deriving (CompatibleKafkaVersion -> CompatibleKafkaVersion -> Bool
(CompatibleKafkaVersion -> CompatibleKafkaVersion -> Bool)
-> (CompatibleKafkaVersion -> CompatibleKafkaVersion -> Bool)
-> Eq CompatibleKafkaVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompatibleKafkaVersion -> CompatibleKafkaVersion -> Bool
$c/= :: CompatibleKafkaVersion -> CompatibleKafkaVersion -> Bool
== :: CompatibleKafkaVersion -> CompatibleKafkaVersion -> Bool
$c== :: CompatibleKafkaVersion -> CompatibleKafkaVersion -> Bool
Prelude.Eq, ReadPrec [CompatibleKafkaVersion]
ReadPrec CompatibleKafkaVersion
Int -> ReadS CompatibleKafkaVersion
ReadS [CompatibleKafkaVersion]
(Int -> ReadS CompatibleKafkaVersion)
-> ReadS [CompatibleKafkaVersion]
-> ReadPrec CompatibleKafkaVersion
-> ReadPrec [CompatibleKafkaVersion]
-> Read CompatibleKafkaVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompatibleKafkaVersion]
$creadListPrec :: ReadPrec [CompatibleKafkaVersion]
readPrec :: ReadPrec CompatibleKafkaVersion
$creadPrec :: ReadPrec CompatibleKafkaVersion
readList :: ReadS [CompatibleKafkaVersion]
$creadList :: ReadS [CompatibleKafkaVersion]
readsPrec :: Int -> ReadS CompatibleKafkaVersion
$creadsPrec :: Int -> ReadS CompatibleKafkaVersion
Prelude.Read, Int -> CompatibleKafkaVersion -> ShowS
[CompatibleKafkaVersion] -> ShowS
CompatibleKafkaVersion -> String
(Int -> CompatibleKafkaVersion -> ShowS)
-> (CompatibleKafkaVersion -> String)
-> ([CompatibleKafkaVersion] -> ShowS)
-> Show CompatibleKafkaVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompatibleKafkaVersion] -> ShowS
$cshowList :: [CompatibleKafkaVersion] -> ShowS
show :: CompatibleKafkaVersion -> String
$cshow :: CompatibleKafkaVersion -> String
showsPrec :: Int -> CompatibleKafkaVersion -> ShowS
$cshowsPrec :: Int -> CompatibleKafkaVersion -> ShowS
Prelude.Show, (forall x. CompatibleKafkaVersion -> Rep CompatibleKafkaVersion x)
-> (forall x.
Rep CompatibleKafkaVersion x -> CompatibleKafkaVersion)
-> Generic CompatibleKafkaVersion
forall x. Rep CompatibleKafkaVersion x -> CompatibleKafkaVersion
forall x. CompatibleKafkaVersion -> Rep CompatibleKafkaVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompatibleKafkaVersion x -> CompatibleKafkaVersion
$cfrom :: forall x. CompatibleKafkaVersion -> Rep CompatibleKafkaVersion x
Prelude.Generic)
newCompatibleKafkaVersion ::
CompatibleKafkaVersion
newCompatibleKafkaVersion :: CompatibleKafkaVersion
newCompatibleKafkaVersion =
CompatibleKafkaVersion' :: Maybe Text -> Maybe [Text] -> CompatibleKafkaVersion
CompatibleKafkaVersion'
{ $sel:sourceVersion:CompatibleKafkaVersion' :: Maybe Text
sourceVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetVersions:CompatibleKafkaVersion' :: Maybe [Text]
targetVersions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
compatibleKafkaVersion_sourceVersion :: Lens.Lens' CompatibleKafkaVersion (Prelude.Maybe Prelude.Text)
compatibleKafkaVersion_sourceVersion :: (Maybe Text -> f (Maybe Text))
-> CompatibleKafkaVersion -> f CompatibleKafkaVersion
compatibleKafkaVersion_sourceVersion = (CompatibleKafkaVersion -> Maybe Text)
-> (CompatibleKafkaVersion -> Maybe Text -> CompatibleKafkaVersion)
-> Lens
CompatibleKafkaVersion
CompatibleKafkaVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompatibleKafkaVersion' {Maybe Text
sourceVersion :: Maybe Text
$sel:sourceVersion:CompatibleKafkaVersion' :: CompatibleKafkaVersion -> Maybe Text
sourceVersion} -> Maybe Text
sourceVersion) (\s :: CompatibleKafkaVersion
s@CompatibleKafkaVersion' {} Maybe Text
a -> CompatibleKafkaVersion
s {$sel:sourceVersion:CompatibleKafkaVersion' :: Maybe Text
sourceVersion = Maybe Text
a} :: CompatibleKafkaVersion)
compatibleKafkaVersion_targetVersions :: Lens.Lens' CompatibleKafkaVersion (Prelude.Maybe [Prelude.Text])
compatibleKafkaVersion_targetVersions :: (Maybe [Text] -> f (Maybe [Text]))
-> CompatibleKafkaVersion -> f CompatibleKafkaVersion
compatibleKafkaVersion_targetVersions = (CompatibleKafkaVersion -> Maybe [Text])
-> (CompatibleKafkaVersion
-> Maybe [Text] -> CompatibleKafkaVersion)
-> Lens
CompatibleKafkaVersion
CompatibleKafkaVersion
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompatibleKafkaVersion' {Maybe [Text]
targetVersions :: Maybe [Text]
$sel:targetVersions:CompatibleKafkaVersion' :: CompatibleKafkaVersion -> Maybe [Text]
targetVersions} -> Maybe [Text]
targetVersions) (\s :: CompatibleKafkaVersion
s@CompatibleKafkaVersion' {} Maybe [Text]
a -> CompatibleKafkaVersion
s {$sel:targetVersions:CompatibleKafkaVersion' :: Maybe [Text]
targetVersions = Maybe [Text]
a} :: CompatibleKafkaVersion) ((Maybe [Text] -> f (Maybe [Text]))
-> CompatibleKafkaVersion -> f CompatibleKafkaVersion)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CompatibleKafkaVersion
-> f CompatibleKafkaVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CompatibleKafkaVersion where
parseJSON :: Value -> Parser CompatibleKafkaVersion
parseJSON =
String
-> (Object -> Parser CompatibleKafkaVersion)
-> Value
-> Parser CompatibleKafkaVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CompatibleKafkaVersion"
( \Object
x ->
Maybe Text -> Maybe [Text] -> CompatibleKafkaVersion
CompatibleKafkaVersion'
(Maybe Text -> Maybe [Text] -> CompatibleKafkaVersion)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> CompatibleKafkaVersion)
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
"sourceVersion")
Parser (Maybe [Text] -> CompatibleKafkaVersion)
-> Parser (Maybe [Text]) -> Parser CompatibleKafkaVersion
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targetVersions"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable CompatibleKafkaVersion
instance Prelude.NFData CompatibleKafkaVersion