{-# 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.ElasticBeanstalk.Types.ApplicationResourceLifecycleConfig where
import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types.ApplicationVersionLifecycleConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApplicationResourceLifecycleConfig = ApplicationResourceLifecycleConfig'
{
ApplicationResourceLifecycleConfig
-> Maybe ApplicationVersionLifecycleConfig
versionLifecycleConfig :: Prelude.Maybe ApplicationVersionLifecycleConfig,
ApplicationResourceLifecycleConfig -> Maybe Text
serviceRole :: Prelude.Maybe Prelude.Text
}
deriving (ApplicationResourceLifecycleConfig
-> ApplicationResourceLifecycleConfig -> Bool
(ApplicationResourceLifecycleConfig
-> ApplicationResourceLifecycleConfig -> Bool)
-> (ApplicationResourceLifecycleConfig
-> ApplicationResourceLifecycleConfig -> Bool)
-> Eq ApplicationResourceLifecycleConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationResourceLifecycleConfig
-> ApplicationResourceLifecycleConfig -> Bool
$c/= :: ApplicationResourceLifecycleConfig
-> ApplicationResourceLifecycleConfig -> Bool
== :: ApplicationResourceLifecycleConfig
-> ApplicationResourceLifecycleConfig -> Bool
$c== :: ApplicationResourceLifecycleConfig
-> ApplicationResourceLifecycleConfig -> Bool
Prelude.Eq, ReadPrec [ApplicationResourceLifecycleConfig]
ReadPrec ApplicationResourceLifecycleConfig
Int -> ReadS ApplicationResourceLifecycleConfig
ReadS [ApplicationResourceLifecycleConfig]
(Int -> ReadS ApplicationResourceLifecycleConfig)
-> ReadS [ApplicationResourceLifecycleConfig]
-> ReadPrec ApplicationResourceLifecycleConfig
-> ReadPrec [ApplicationResourceLifecycleConfig]
-> Read ApplicationResourceLifecycleConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationResourceLifecycleConfig]
$creadListPrec :: ReadPrec [ApplicationResourceLifecycleConfig]
readPrec :: ReadPrec ApplicationResourceLifecycleConfig
$creadPrec :: ReadPrec ApplicationResourceLifecycleConfig
readList :: ReadS [ApplicationResourceLifecycleConfig]
$creadList :: ReadS [ApplicationResourceLifecycleConfig]
readsPrec :: Int -> ReadS ApplicationResourceLifecycleConfig
$creadsPrec :: Int -> ReadS ApplicationResourceLifecycleConfig
Prelude.Read, Int -> ApplicationResourceLifecycleConfig -> ShowS
[ApplicationResourceLifecycleConfig] -> ShowS
ApplicationResourceLifecycleConfig -> String
(Int -> ApplicationResourceLifecycleConfig -> ShowS)
-> (ApplicationResourceLifecycleConfig -> String)
-> ([ApplicationResourceLifecycleConfig] -> ShowS)
-> Show ApplicationResourceLifecycleConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationResourceLifecycleConfig] -> ShowS
$cshowList :: [ApplicationResourceLifecycleConfig] -> ShowS
show :: ApplicationResourceLifecycleConfig -> String
$cshow :: ApplicationResourceLifecycleConfig -> String
showsPrec :: Int -> ApplicationResourceLifecycleConfig -> ShowS
$cshowsPrec :: Int -> ApplicationResourceLifecycleConfig -> ShowS
Prelude.Show, (forall x.
ApplicationResourceLifecycleConfig
-> Rep ApplicationResourceLifecycleConfig x)
-> (forall x.
Rep ApplicationResourceLifecycleConfig x
-> ApplicationResourceLifecycleConfig)
-> Generic ApplicationResourceLifecycleConfig
forall x.
Rep ApplicationResourceLifecycleConfig x
-> ApplicationResourceLifecycleConfig
forall x.
ApplicationResourceLifecycleConfig
-> Rep ApplicationResourceLifecycleConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationResourceLifecycleConfig x
-> ApplicationResourceLifecycleConfig
$cfrom :: forall x.
ApplicationResourceLifecycleConfig
-> Rep ApplicationResourceLifecycleConfig x
Prelude.Generic)
newApplicationResourceLifecycleConfig ::
ApplicationResourceLifecycleConfig
newApplicationResourceLifecycleConfig :: ApplicationResourceLifecycleConfig
newApplicationResourceLifecycleConfig =
ApplicationResourceLifecycleConfig' :: Maybe ApplicationVersionLifecycleConfig
-> Maybe Text -> ApplicationResourceLifecycleConfig
ApplicationResourceLifecycleConfig'
{ $sel:versionLifecycleConfig:ApplicationResourceLifecycleConfig' :: Maybe ApplicationVersionLifecycleConfig
versionLifecycleConfig =
Maybe ApplicationVersionLifecycleConfig
forall a. Maybe a
Prelude.Nothing,
$sel:serviceRole:ApplicationResourceLifecycleConfig' :: Maybe Text
serviceRole = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
applicationResourceLifecycleConfig_versionLifecycleConfig :: Lens.Lens' ApplicationResourceLifecycleConfig (Prelude.Maybe ApplicationVersionLifecycleConfig)
applicationResourceLifecycleConfig_versionLifecycleConfig :: (Maybe ApplicationVersionLifecycleConfig
-> f (Maybe ApplicationVersionLifecycleConfig))
-> ApplicationResourceLifecycleConfig
-> f ApplicationResourceLifecycleConfig
applicationResourceLifecycleConfig_versionLifecycleConfig = (ApplicationResourceLifecycleConfig
-> Maybe ApplicationVersionLifecycleConfig)
-> (ApplicationResourceLifecycleConfig
-> Maybe ApplicationVersionLifecycleConfig
-> ApplicationResourceLifecycleConfig)
-> Lens
ApplicationResourceLifecycleConfig
ApplicationResourceLifecycleConfig
(Maybe ApplicationVersionLifecycleConfig)
(Maybe ApplicationVersionLifecycleConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationResourceLifecycleConfig' {Maybe ApplicationVersionLifecycleConfig
versionLifecycleConfig :: Maybe ApplicationVersionLifecycleConfig
$sel:versionLifecycleConfig:ApplicationResourceLifecycleConfig' :: ApplicationResourceLifecycleConfig
-> Maybe ApplicationVersionLifecycleConfig
versionLifecycleConfig} -> Maybe ApplicationVersionLifecycleConfig
versionLifecycleConfig) (\s :: ApplicationResourceLifecycleConfig
s@ApplicationResourceLifecycleConfig' {} Maybe ApplicationVersionLifecycleConfig
a -> ApplicationResourceLifecycleConfig
s {$sel:versionLifecycleConfig:ApplicationResourceLifecycleConfig' :: Maybe ApplicationVersionLifecycleConfig
versionLifecycleConfig = Maybe ApplicationVersionLifecycleConfig
a} :: ApplicationResourceLifecycleConfig)
applicationResourceLifecycleConfig_serviceRole :: Lens.Lens' ApplicationResourceLifecycleConfig (Prelude.Maybe Prelude.Text)
applicationResourceLifecycleConfig_serviceRole :: (Maybe Text -> f (Maybe Text))
-> ApplicationResourceLifecycleConfig
-> f ApplicationResourceLifecycleConfig
applicationResourceLifecycleConfig_serviceRole = (ApplicationResourceLifecycleConfig -> Maybe Text)
-> (ApplicationResourceLifecycleConfig
-> Maybe Text -> ApplicationResourceLifecycleConfig)
-> Lens
ApplicationResourceLifecycleConfig
ApplicationResourceLifecycleConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationResourceLifecycleConfig' {Maybe Text
serviceRole :: Maybe Text
$sel:serviceRole:ApplicationResourceLifecycleConfig' :: ApplicationResourceLifecycleConfig -> Maybe Text
serviceRole} -> Maybe Text
serviceRole) (\s :: ApplicationResourceLifecycleConfig
s@ApplicationResourceLifecycleConfig' {} Maybe Text
a -> ApplicationResourceLifecycleConfig
s {$sel:serviceRole:ApplicationResourceLifecycleConfig' :: Maybe Text
serviceRole = Maybe Text
a} :: ApplicationResourceLifecycleConfig)
instance
Core.FromXML
ApplicationResourceLifecycleConfig
where
parseXML :: [Node] -> Either String ApplicationResourceLifecycleConfig
parseXML [Node]
x =
Maybe ApplicationVersionLifecycleConfig
-> Maybe Text -> ApplicationResourceLifecycleConfig
ApplicationResourceLifecycleConfig'
(Maybe ApplicationVersionLifecycleConfig
-> Maybe Text -> ApplicationResourceLifecycleConfig)
-> Either String (Maybe ApplicationVersionLifecycleConfig)
-> Either String (Maybe Text -> ApplicationResourceLifecycleConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text -> Either String (Maybe ApplicationVersionLifecycleConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VersionLifecycleConfig")
Either String (Maybe Text -> ApplicationResourceLifecycleConfig)
-> Either String (Maybe Text)
-> Either String ApplicationResourceLifecycleConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ServiceRole")
instance
Prelude.Hashable
ApplicationResourceLifecycleConfig
instance
Prelude.NFData
ApplicationResourceLifecycleConfig
instance
Core.ToQuery
ApplicationResourceLifecycleConfig
where
toQuery :: ApplicationResourceLifecycleConfig -> QueryString
toQuery ApplicationResourceLifecycleConfig' {Maybe Text
Maybe ApplicationVersionLifecycleConfig
serviceRole :: Maybe Text
versionLifecycleConfig :: Maybe ApplicationVersionLifecycleConfig
$sel:serviceRole:ApplicationResourceLifecycleConfig' :: ApplicationResourceLifecycleConfig -> Maybe Text
$sel:versionLifecycleConfig:ApplicationResourceLifecycleConfig' :: ApplicationResourceLifecycleConfig
-> Maybe ApplicationVersionLifecycleConfig
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"VersionLifecycleConfig"
ByteString
-> Maybe ApplicationVersionLifecycleConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ApplicationVersionLifecycleConfig
versionLifecycleConfig,
ByteString
"ServiceRole" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
serviceRole
]