{-# 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.Configuration where
import qualified Amazonka.Core as Core
import Amazonka.Kafka.Types.ConfigurationRevision
import Amazonka.Kafka.Types.ConfigurationState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Configuration = Configuration'
{
Configuration -> Text
description :: Prelude.Text,
Configuration -> ConfigurationRevision
latestRevision :: ConfigurationRevision,
Configuration -> POSIX
creationTime :: Core.POSIX,
Configuration -> [Text]
kafkaVersions :: [Prelude.Text],
Configuration -> Text
arn :: Prelude.Text,
Configuration -> Text
name :: Prelude.Text,
Configuration -> ConfigurationState
state :: ConfigurationState
}
deriving (Configuration -> Configuration -> Bool
(Configuration -> Configuration -> Bool)
-> (Configuration -> Configuration -> Bool) -> Eq Configuration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Configuration -> Configuration -> Bool
$c/= :: Configuration -> Configuration -> Bool
== :: Configuration -> Configuration -> Bool
$c== :: Configuration -> Configuration -> Bool
Prelude.Eq, ReadPrec [Configuration]
ReadPrec Configuration
Int -> ReadS Configuration
ReadS [Configuration]
(Int -> ReadS Configuration)
-> ReadS [Configuration]
-> ReadPrec Configuration
-> ReadPrec [Configuration]
-> Read Configuration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Configuration]
$creadListPrec :: ReadPrec [Configuration]
readPrec :: ReadPrec Configuration
$creadPrec :: ReadPrec Configuration
readList :: ReadS [Configuration]
$creadList :: ReadS [Configuration]
readsPrec :: Int -> ReadS Configuration
$creadsPrec :: Int -> ReadS Configuration
Prelude.Read, Int -> Configuration -> ShowS
[Configuration] -> ShowS
Configuration -> String
(Int -> Configuration -> ShowS)
-> (Configuration -> String)
-> ([Configuration] -> ShowS)
-> Show Configuration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Configuration] -> ShowS
$cshowList :: [Configuration] -> ShowS
show :: Configuration -> String
$cshow :: Configuration -> String
showsPrec :: Int -> Configuration -> ShowS
$cshowsPrec :: Int -> Configuration -> ShowS
Prelude.Show, (forall x. Configuration -> Rep Configuration x)
-> (forall x. Rep Configuration x -> Configuration)
-> Generic Configuration
forall x. Rep Configuration x -> Configuration
forall x. Configuration -> Rep Configuration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Configuration x -> Configuration
$cfrom :: forall x. Configuration -> Rep Configuration x
Prelude.Generic)
newConfiguration ::
Prelude.Text ->
ConfigurationRevision ->
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
ConfigurationState ->
Configuration
newConfiguration :: Text
-> ConfigurationRevision
-> UTCTime
-> Text
-> Text
-> ConfigurationState
-> Configuration
newConfiguration
Text
pDescription_
ConfigurationRevision
pLatestRevision_
UTCTime
pCreationTime_
Text
pArn_
Text
pName_
ConfigurationState
pState_ =
Configuration' :: Text
-> ConfigurationRevision
-> POSIX
-> [Text]
-> Text
-> Text
-> ConfigurationState
-> Configuration
Configuration'
{ $sel:description:Configuration' :: Text
description = Text
pDescription_,
$sel:latestRevision:Configuration' :: ConfigurationRevision
latestRevision = ConfigurationRevision
pLatestRevision_,
$sel:creationTime:Configuration' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
$sel:kafkaVersions:Configuration' :: [Text]
kafkaVersions = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:arn:Configuration' :: Text
arn = Text
pArn_,
$sel:name:Configuration' :: Text
name = Text
pName_,
$sel:state:Configuration' :: ConfigurationState
state = ConfigurationState
pState_
}
configuration_description :: Lens.Lens' Configuration Prelude.Text
configuration_description :: (Text -> f Text) -> Configuration -> f Configuration
configuration_description = (Configuration -> Text)
-> (Configuration -> Text -> Configuration)
-> Lens Configuration Configuration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {Text
description :: Text
$sel:description:Configuration' :: Configuration -> Text
description} -> Text
description) (\s :: Configuration
s@Configuration' {} Text
a -> Configuration
s {$sel:description:Configuration' :: Text
description = Text
a} :: Configuration)
configuration_latestRevision :: Lens.Lens' Configuration ConfigurationRevision
configuration_latestRevision :: (ConfigurationRevision -> f ConfigurationRevision)
-> Configuration -> f Configuration
configuration_latestRevision = (Configuration -> ConfigurationRevision)
-> (Configuration -> ConfigurationRevision -> Configuration)
-> Lens
Configuration
Configuration
ConfigurationRevision
ConfigurationRevision
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {ConfigurationRevision
latestRevision :: ConfigurationRevision
$sel:latestRevision:Configuration' :: Configuration -> ConfigurationRevision
latestRevision} -> ConfigurationRevision
latestRevision) (\s :: Configuration
s@Configuration' {} ConfigurationRevision
a -> Configuration
s {$sel:latestRevision:Configuration' :: ConfigurationRevision
latestRevision = ConfigurationRevision
a} :: Configuration)
configuration_creationTime :: Lens.Lens' Configuration Prelude.UTCTime
configuration_creationTime :: (UTCTime -> f UTCTime) -> Configuration -> f Configuration
configuration_creationTime = (Configuration -> POSIX)
-> (Configuration -> POSIX -> Configuration)
-> Lens Configuration Configuration POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {POSIX
creationTime :: POSIX
$sel:creationTime:Configuration' :: Configuration -> POSIX
creationTime} -> POSIX
creationTime) (\s :: Configuration
s@Configuration' {} POSIX
a -> Configuration
s {$sel:creationTime:Configuration' :: POSIX
creationTime = POSIX
a} :: Configuration) ((POSIX -> f POSIX) -> Configuration -> f Configuration)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Configuration
-> f Configuration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
configuration_kafkaVersions :: Lens.Lens' Configuration [Prelude.Text]
configuration_kafkaVersions :: ([Text] -> f [Text]) -> Configuration -> f Configuration
configuration_kafkaVersions = (Configuration -> [Text])
-> (Configuration -> [Text] -> Configuration)
-> Lens Configuration Configuration [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {[Text]
kafkaVersions :: [Text]
$sel:kafkaVersions:Configuration' :: Configuration -> [Text]
kafkaVersions} -> [Text]
kafkaVersions) (\s :: Configuration
s@Configuration' {} [Text]
a -> Configuration
s {$sel:kafkaVersions:Configuration' :: [Text]
kafkaVersions = [Text]
a} :: Configuration) (([Text] -> f [Text]) -> Configuration -> f Configuration)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> Configuration
-> f Configuration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
configuration_arn :: Lens.Lens' Configuration Prelude.Text
configuration_arn :: (Text -> f Text) -> Configuration -> f Configuration
configuration_arn = (Configuration -> Text)
-> (Configuration -> Text -> Configuration)
-> Lens Configuration Configuration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {Text
arn :: Text
$sel:arn:Configuration' :: Configuration -> Text
arn} -> Text
arn) (\s :: Configuration
s@Configuration' {} Text
a -> Configuration
s {$sel:arn:Configuration' :: Text
arn = Text
a} :: Configuration)
configuration_name :: Lens.Lens' Configuration Prelude.Text
configuration_name :: (Text -> f Text) -> Configuration -> f Configuration
configuration_name = (Configuration -> Text)
-> (Configuration -> Text -> Configuration)
-> Lens Configuration Configuration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {Text
name :: Text
$sel:name:Configuration' :: Configuration -> Text
name} -> Text
name) (\s :: Configuration
s@Configuration' {} Text
a -> Configuration
s {$sel:name:Configuration' :: Text
name = Text
a} :: Configuration)
configuration_state :: Lens.Lens' Configuration ConfigurationState
configuration_state :: (ConfigurationState -> f ConfigurationState)
-> Configuration -> f Configuration
configuration_state = (Configuration -> ConfigurationState)
-> (Configuration -> ConfigurationState -> Configuration)
-> Lens
Configuration Configuration ConfigurationState ConfigurationState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {ConfigurationState
state :: ConfigurationState
$sel:state:Configuration' :: Configuration -> ConfigurationState
state} -> ConfigurationState
state) (\s :: Configuration
s@Configuration' {} ConfigurationState
a -> Configuration
s {$sel:state:Configuration' :: ConfigurationState
state = ConfigurationState
a} :: Configuration)
instance Core.FromJSON Configuration where
parseJSON :: Value -> Parser Configuration
parseJSON =
String
-> (Object -> Parser Configuration)
-> Value
-> Parser Configuration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Configuration"
( \Object
x ->
Text
-> ConfigurationRevision
-> POSIX
-> [Text]
-> Text
-> Text
-> ConfigurationState
-> Configuration
Configuration'
(Text
-> ConfigurationRevision
-> POSIX
-> [Text]
-> Text
-> Text
-> ConfigurationState
-> Configuration)
-> Parser Text
-> Parser
(ConfigurationRevision
-> POSIX
-> [Text]
-> Text
-> Text
-> ConfigurationState
-> Configuration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"description")
Parser
(ConfigurationRevision
-> POSIX
-> [Text]
-> Text
-> Text
-> ConfigurationState
-> Configuration)
-> Parser ConfigurationRevision
-> Parser
(POSIX
-> [Text] -> Text -> Text -> ConfigurationState -> Configuration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ConfigurationRevision
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"latestRevision")
Parser
(POSIX
-> [Text] -> Text -> Text -> ConfigurationState -> Configuration)
-> Parser POSIX
-> Parser
([Text] -> Text -> Text -> ConfigurationState -> Configuration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"creationTime")
Parser
([Text] -> Text -> Text -> ConfigurationState -> Configuration)
-> Parser [Text]
-> Parser (Text -> Text -> ConfigurationState -> Configuration)
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
"kafkaVersions" Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> Text -> ConfigurationState -> Configuration)
-> Parser Text
-> Parser (Text -> ConfigurationState -> Configuration)
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")
Parser (Text -> ConfigurationState -> Configuration)
-> Parser Text -> Parser (ConfigurationState -> Configuration)
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
"name")
Parser (ConfigurationState -> Configuration)
-> Parser ConfigurationState -> Parser Configuration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ConfigurationState
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"state")
)
instance Prelude.Hashable Configuration
instance Prelude.NFData Configuration