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