{-# 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.MQ.Types.Configuration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MQ.Types.AuthenticationStrategy
import Amazonka.MQ.Types.ConfigurationRevision
import Amazonka.MQ.Types.EngineType
import qualified Amazonka.Prelude as Prelude
data Configuration = Configuration'
{
Configuration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Configuration -> Text
description :: Prelude.Text,
Configuration -> Text
engineVersion :: Prelude.Text,
Configuration -> ConfigurationRevision
latestRevision :: ConfigurationRevision,
Configuration -> AuthenticationStrategy
authenticationStrategy :: AuthenticationStrategy,
Configuration -> EngineType
engineType :: EngineType,
Configuration -> Text
id :: Prelude.Text,
Configuration -> Text
arn :: Prelude.Text,
Configuration -> Text
name :: Prelude.Text,
Configuration -> POSIX
created :: Core.POSIX
}
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 ->
Prelude.Text ->
ConfigurationRevision ->
AuthenticationStrategy ->
EngineType ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Configuration
newConfiguration :: Text
-> Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> UTCTime
-> Configuration
newConfiguration
Text
pDescription_
Text
pEngineVersion_
ConfigurationRevision
pLatestRevision_
AuthenticationStrategy
pAuthenticationStrategy_
EngineType
pEngineType_
Text
pId_
Text
pArn_
Text
pName_
UTCTime
pCreated_ =
Configuration' :: Maybe (HashMap Text Text)
-> Text
-> Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> Configuration
Configuration'
{ $sel:tags:Configuration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:description:Configuration' :: Text
description = Text
pDescription_,
$sel:engineVersion:Configuration' :: Text
engineVersion = Text
pEngineVersion_,
$sel:latestRevision:Configuration' :: ConfigurationRevision
latestRevision = ConfigurationRevision
pLatestRevision_,
$sel:authenticationStrategy:Configuration' :: AuthenticationStrategy
authenticationStrategy = AuthenticationStrategy
pAuthenticationStrategy_,
$sel:engineType:Configuration' :: EngineType
engineType = EngineType
pEngineType_,
$sel:id:Configuration' :: Text
id = Text
pId_,
$sel:arn:Configuration' :: Text
arn = Text
pArn_,
$sel:name:Configuration' :: Text
name = Text
pName_,
$sel:created:Configuration' :: POSIX
created = 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
pCreated_
}
configuration_tags :: Lens.Lens' Configuration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
configuration_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Configuration -> f Configuration
configuration_tags = (Configuration -> Maybe (HashMap Text Text))
-> (Configuration -> Maybe (HashMap Text Text) -> Configuration)
-> Lens
Configuration
Configuration
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Configuration' :: Configuration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Configuration
s@Configuration' {} Maybe (HashMap Text Text)
a -> Configuration
s {$sel:tags:Configuration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Configuration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Configuration -> f Configuration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Configuration
-> f Configuration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
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_engineVersion :: Lens.Lens' Configuration Prelude.Text
configuration_engineVersion :: (Text -> f Text) -> Configuration -> f Configuration
configuration_engineVersion = (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
engineVersion :: Text
$sel:engineVersion:Configuration' :: Configuration -> Text
engineVersion} -> Text
engineVersion) (\s :: Configuration
s@Configuration' {} Text
a -> Configuration
s {$sel:engineVersion:Configuration' :: Text
engineVersion = 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_authenticationStrategy :: Lens.Lens' Configuration AuthenticationStrategy
configuration_authenticationStrategy :: (AuthenticationStrategy -> f AuthenticationStrategy)
-> Configuration -> f Configuration
configuration_authenticationStrategy = (Configuration -> AuthenticationStrategy)
-> (Configuration -> AuthenticationStrategy -> Configuration)
-> Lens
Configuration
Configuration
AuthenticationStrategy
AuthenticationStrategy
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {AuthenticationStrategy
authenticationStrategy :: AuthenticationStrategy
$sel:authenticationStrategy:Configuration' :: Configuration -> AuthenticationStrategy
authenticationStrategy} -> AuthenticationStrategy
authenticationStrategy) (\s :: Configuration
s@Configuration' {} AuthenticationStrategy
a -> Configuration
s {$sel:authenticationStrategy:Configuration' :: AuthenticationStrategy
authenticationStrategy = AuthenticationStrategy
a} :: Configuration)
configuration_engineType :: Lens.Lens' Configuration EngineType
configuration_engineType :: (EngineType -> f EngineType) -> Configuration -> f Configuration
configuration_engineType = (Configuration -> EngineType)
-> (Configuration -> EngineType -> Configuration)
-> Lens Configuration Configuration EngineType EngineType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Configuration' {EngineType
engineType :: EngineType
$sel:engineType:Configuration' :: Configuration -> EngineType
engineType} -> EngineType
engineType) (\s :: Configuration
s@Configuration' {} EngineType
a -> Configuration
s {$sel:engineType:Configuration' :: EngineType
engineType = EngineType
a} :: Configuration)
configuration_id :: Lens.Lens' Configuration Prelude.Text
configuration_id :: (Text -> f Text) -> Configuration -> f Configuration
configuration_id = (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
id :: Text
$sel:id:Configuration' :: Configuration -> Text
id} -> Text
id) (\s :: Configuration
s@Configuration' {} Text
a -> Configuration
s {$sel:id:Configuration' :: Text
id = Text
a} :: Configuration)
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_created :: Lens.Lens' Configuration Prelude.UTCTime
configuration_created :: (UTCTime -> f UTCTime) -> Configuration -> f Configuration
configuration_created = (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
created :: POSIX
$sel:created:Configuration' :: Configuration -> POSIX
created} -> POSIX
created) (\s :: Configuration
s@Configuration' {} POSIX
a -> Configuration
s {$sel:created:Configuration' :: POSIX
created = 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
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 ->
Maybe (HashMap Text Text)
-> Text
-> Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> Configuration
Configuration'
(Maybe (HashMap Text Text)
-> Text
-> Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> Configuration)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Text
-> Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> Configuration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser
(Text
-> Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> Configuration)
-> Parser Text
-> Parser
(Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> 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
"description")
Parser
(Text
-> ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> Configuration)
-> Parser Text
-> Parser
(ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> 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
"engineVersion")
Parser
(ConfigurationRevision
-> AuthenticationStrategy
-> EngineType
-> Text
-> Text
-> Text
-> POSIX
-> Configuration)
-> Parser ConfigurationRevision
-> Parser
(AuthenticationStrategy
-> EngineType -> Text -> Text -> Text -> POSIX -> 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
(AuthenticationStrategy
-> EngineType -> Text -> Text -> Text -> POSIX -> Configuration)
-> Parser AuthenticationStrategy
-> Parser
(EngineType -> Text -> Text -> Text -> POSIX -> Configuration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AuthenticationStrategy
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"authenticationStrategy")
Parser
(EngineType -> Text -> Text -> Text -> POSIX -> Configuration)
-> Parser EngineType
-> Parser (Text -> Text -> Text -> POSIX -> Configuration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser EngineType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"engineType")
Parser (Text -> Text -> Text -> POSIX -> Configuration)
-> Parser Text -> Parser (Text -> Text -> POSIX -> 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
"id")
Parser (Text -> Text -> POSIX -> Configuration)
-> Parser Text -> Parser (Text -> POSIX -> 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 -> POSIX -> Configuration)
-> Parser Text -> Parser (POSIX -> 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 (POSIX -> Configuration)
-> Parser POSIX -> Parser 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
"created")
)
instance Prelude.Hashable Configuration
instance Prelude.NFData Configuration