{-# 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.ELB.Types.AccessLog where
import qualified Amazonka.Core as Core
import Amazonka.ELB.Internal
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccessLog = AccessLog'
{
AccessLog -> Maybe Int
emitInterval :: Prelude.Maybe Prelude.Int,
AccessLog -> Maybe Text
s3BucketPrefix :: Prelude.Maybe Prelude.Text,
AccessLog -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text,
AccessLog -> Bool
enabled :: Prelude.Bool
}
deriving (AccessLog -> AccessLog -> Bool
(AccessLog -> AccessLog -> Bool)
-> (AccessLog -> AccessLog -> Bool) -> Eq AccessLog
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessLog -> AccessLog -> Bool
$c/= :: AccessLog -> AccessLog -> Bool
== :: AccessLog -> AccessLog -> Bool
$c== :: AccessLog -> AccessLog -> Bool
Prelude.Eq, ReadPrec [AccessLog]
ReadPrec AccessLog
Int -> ReadS AccessLog
ReadS [AccessLog]
(Int -> ReadS AccessLog)
-> ReadS [AccessLog]
-> ReadPrec AccessLog
-> ReadPrec [AccessLog]
-> Read AccessLog
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessLog]
$creadListPrec :: ReadPrec [AccessLog]
readPrec :: ReadPrec AccessLog
$creadPrec :: ReadPrec AccessLog
readList :: ReadS [AccessLog]
$creadList :: ReadS [AccessLog]
readsPrec :: Int -> ReadS AccessLog
$creadsPrec :: Int -> ReadS AccessLog
Prelude.Read, Int -> AccessLog -> ShowS
[AccessLog] -> ShowS
AccessLog -> String
(Int -> AccessLog -> ShowS)
-> (AccessLog -> String)
-> ([AccessLog] -> ShowS)
-> Show AccessLog
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessLog] -> ShowS
$cshowList :: [AccessLog] -> ShowS
show :: AccessLog -> String
$cshow :: AccessLog -> String
showsPrec :: Int -> AccessLog -> ShowS
$cshowsPrec :: Int -> AccessLog -> ShowS
Prelude.Show, (forall x. AccessLog -> Rep AccessLog x)
-> (forall x. Rep AccessLog x -> AccessLog) -> Generic AccessLog
forall x. Rep AccessLog x -> AccessLog
forall x. AccessLog -> Rep AccessLog x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessLog x -> AccessLog
$cfrom :: forall x. AccessLog -> Rep AccessLog x
Prelude.Generic)
newAccessLog ::
Prelude.Bool ->
AccessLog
newAccessLog :: Bool -> AccessLog
newAccessLog Bool
pEnabled_ =
AccessLog' :: Maybe Int -> Maybe Text -> Maybe Text -> Bool -> AccessLog
AccessLog'
{ $sel:emitInterval:AccessLog' :: Maybe Int
emitInterval = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:s3BucketPrefix:AccessLog' :: Maybe Text
s3BucketPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3BucketName:AccessLog' :: Maybe Text
s3BucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:AccessLog' :: Bool
enabled = Bool
pEnabled_
}
accessLog_emitInterval :: Lens.Lens' AccessLog (Prelude.Maybe Prelude.Int)
accessLog_emitInterval :: (Maybe Int -> f (Maybe Int)) -> AccessLog -> f AccessLog
accessLog_emitInterval = (AccessLog -> Maybe Int)
-> (AccessLog -> Maybe Int -> AccessLog)
-> Lens AccessLog AccessLog (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessLog' {Maybe Int
emitInterval :: Maybe Int
$sel:emitInterval:AccessLog' :: AccessLog -> Maybe Int
emitInterval} -> Maybe Int
emitInterval) (\s :: AccessLog
s@AccessLog' {} Maybe Int
a -> AccessLog
s {$sel:emitInterval:AccessLog' :: Maybe Int
emitInterval = Maybe Int
a} :: AccessLog)
accessLog_s3BucketPrefix :: Lens.Lens' AccessLog (Prelude.Maybe Prelude.Text)
accessLog_s3BucketPrefix :: (Maybe Text -> f (Maybe Text)) -> AccessLog -> f AccessLog
accessLog_s3BucketPrefix = (AccessLog -> Maybe Text)
-> (AccessLog -> Maybe Text -> AccessLog)
-> Lens AccessLog AccessLog (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessLog' {Maybe Text
s3BucketPrefix :: Maybe Text
$sel:s3BucketPrefix:AccessLog' :: AccessLog -> Maybe Text
s3BucketPrefix} -> Maybe Text
s3BucketPrefix) (\s :: AccessLog
s@AccessLog' {} Maybe Text
a -> AccessLog
s {$sel:s3BucketPrefix:AccessLog' :: Maybe Text
s3BucketPrefix = Maybe Text
a} :: AccessLog)
accessLog_s3BucketName :: Lens.Lens' AccessLog (Prelude.Maybe Prelude.Text)
accessLog_s3BucketName :: (Maybe Text -> f (Maybe Text)) -> AccessLog -> f AccessLog
accessLog_s3BucketName = (AccessLog -> Maybe Text)
-> (AccessLog -> Maybe Text -> AccessLog)
-> Lens AccessLog AccessLog (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessLog' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:AccessLog' :: AccessLog -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: AccessLog
s@AccessLog' {} Maybe Text
a -> AccessLog
s {$sel:s3BucketName:AccessLog' :: Maybe Text
s3BucketName = Maybe Text
a} :: AccessLog)
accessLog_enabled :: Lens.Lens' AccessLog Prelude.Bool
accessLog_enabled :: (Bool -> f Bool) -> AccessLog -> f AccessLog
accessLog_enabled = (AccessLog -> Bool)
-> (AccessLog -> Bool -> AccessLog)
-> Lens AccessLog AccessLog Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessLog' {Bool
enabled :: Bool
$sel:enabled:AccessLog' :: AccessLog -> Bool
enabled} -> Bool
enabled) (\s :: AccessLog
s@AccessLog' {} Bool
a -> AccessLog
s {$sel:enabled:AccessLog' :: Bool
enabled = Bool
a} :: AccessLog)
instance Core.FromXML AccessLog where
parseXML :: [Node] -> Either String AccessLog
parseXML [Node]
x =
Maybe Int -> Maybe Text -> Maybe Text -> Bool -> AccessLog
AccessLog'
(Maybe Int -> Maybe Text -> Maybe Text -> Bool -> AccessLog)
-> Either String (Maybe Int)
-> Either String (Maybe Text -> Maybe Text -> Bool -> AccessLog)
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
"EmitInterval")
Either String (Maybe Text -> Maybe Text -> Bool -> AccessLog)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Bool -> AccessLog)
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
"S3BucketPrefix")
Either String (Maybe Text -> Bool -> AccessLog)
-> Either String (Maybe Text) -> Either String (Bool -> AccessLog)
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
"S3BucketName")
Either String (Bool -> AccessLog)
-> Either String Bool -> Either String AccessLog
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 AccessLog
instance Prelude.NFData AccessLog
instance Core.ToQuery AccessLog where
toQuery :: AccessLog -> QueryString
toQuery AccessLog' {Bool
Maybe Int
Maybe Text
enabled :: Bool
s3BucketName :: Maybe Text
s3BucketPrefix :: Maybe Text
emitInterval :: Maybe Int
$sel:enabled:AccessLog' :: AccessLog -> Bool
$sel:s3BucketName:AccessLog' :: AccessLog -> Maybe Text
$sel:s3BucketPrefix:AccessLog' :: AccessLog -> Maybe Text
$sel:emitInterval:AccessLog' :: AccessLog -> Maybe Int
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"EmitInterval" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
emitInterval,
ByteString
"S3BucketPrefix" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
s3BucketPrefix,
ByteString
"S3BucketName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
s3BucketName,
ByteString
"Enabled" ByteString -> Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Bool
enabled
]