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