{-# 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.CloudFront.Types.StreamingLoggingConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StreamingLoggingConfig = StreamingLoggingConfig'
{
StreamingLoggingConfig -> Bool
enabled :: Prelude.Bool,
StreamingLoggingConfig -> Text
bucket :: Prelude.Text,
StreamingLoggingConfig -> Text
prefix :: Prelude.Text
}
deriving (StreamingLoggingConfig -> StreamingLoggingConfig -> Bool
(StreamingLoggingConfig -> StreamingLoggingConfig -> Bool)
-> (StreamingLoggingConfig -> StreamingLoggingConfig -> Bool)
-> Eq StreamingLoggingConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamingLoggingConfig -> StreamingLoggingConfig -> Bool
$c/= :: StreamingLoggingConfig -> StreamingLoggingConfig -> Bool
== :: StreamingLoggingConfig -> StreamingLoggingConfig -> Bool
$c== :: StreamingLoggingConfig -> StreamingLoggingConfig -> Bool
Prelude.Eq, ReadPrec [StreamingLoggingConfig]
ReadPrec StreamingLoggingConfig
Int -> ReadS StreamingLoggingConfig
ReadS [StreamingLoggingConfig]
(Int -> ReadS StreamingLoggingConfig)
-> ReadS [StreamingLoggingConfig]
-> ReadPrec StreamingLoggingConfig
-> ReadPrec [StreamingLoggingConfig]
-> Read StreamingLoggingConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamingLoggingConfig]
$creadListPrec :: ReadPrec [StreamingLoggingConfig]
readPrec :: ReadPrec StreamingLoggingConfig
$creadPrec :: ReadPrec StreamingLoggingConfig
readList :: ReadS [StreamingLoggingConfig]
$creadList :: ReadS [StreamingLoggingConfig]
readsPrec :: Int -> ReadS StreamingLoggingConfig
$creadsPrec :: Int -> ReadS StreamingLoggingConfig
Prelude.Read, Int -> StreamingLoggingConfig -> ShowS
[StreamingLoggingConfig] -> ShowS
StreamingLoggingConfig -> String
(Int -> StreamingLoggingConfig -> ShowS)
-> (StreamingLoggingConfig -> String)
-> ([StreamingLoggingConfig] -> ShowS)
-> Show StreamingLoggingConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamingLoggingConfig] -> ShowS
$cshowList :: [StreamingLoggingConfig] -> ShowS
show :: StreamingLoggingConfig -> String
$cshow :: StreamingLoggingConfig -> String
showsPrec :: Int -> StreamingLoggingConfig -> ShowS
$cshowsPrec :: Int -> StreamingLoggingConfig -> ShowS
Prelude.Show, (forall x. StreamingLoggingConfig -> Rep StreamingLoggingConfig x)
-> (forall x.
Rep StreamingLoggingConfig x -> StreamingLoggingConfig)
-> Generic StreamingLoggingConfig
forall x. Rep StreamingLoggingConfig x -> StreamingLoggingConfig
forall x. StreamingLoggingConfig -> Rep StreamingLoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamingLoggingConfig x -> StreamingLoggingConfig
$cfrom :: forall x. StreamingLoggingConfig -> Rep StreamingLoggingConfig x
Prelude.Generic)
newStreamingLoggingConfig ::
Prelude.Bool ->
Prelude.Text ->
Prelude.Text ->
StreamingLoggingConfig
newStreamingLoggingConfig :: Bool -> Text -> Text -> StreamingLoggingConfig
newStreamingLoggingConfig Bool
pEnabled_ Text
pBucket_ Text
pPrefix_ =
StreamingLoggingConfig' :: Bool -> Text -> Text -> StreamingLoggingConfig
StreamingLoggingConfig'
{ $sel:enabled:StreamingLoggingConfig' :: Bool
enabled = Bool
pEnabled_,
$sel:bucket:StreamingLoggingConfig' :: Text
bucket = Text
pBucket_,
$sel:prefix:StreamingLoggingConfig' :: Text
prefix = Text
pPrefix_
}
streamingLoggingConfig_enabled :: Lens.Lens' StreamingLoggingConfig Prelude.Bool
streamingLoggingConfig_enabled :: (Bool -> f Bool)
-> StreamingLoggingConfig -> f StreamingLoggingConfig
streamingLoggingConfig_enabled = (StreamingLoggingConfig -> Bool)
-> (StreamingLoggingConfig -> Bool -> StreamingLoggingConfig)
-> Lens StreamingLoggingConfig StreamingLoggingConfig Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingLoggingConfig' {Bool
enabled :: Bool
$sel:enabled:StreamingLoggingConfig' :: StreamingLoggingConfig -> Bool
enabled} -> Bool
enabled) (\s :: StreamingLoggingConfig
s@StreamingLoggingConfig' {} Bool
a -> StreamingLoggingConfig
s {$sel:enabled:StreamingLoggingConfig' :: Bool
enabled = Bool
a} :: StreamingLoggingConfig)
streamingLoggingConfig_bucket :: Lens.Lens' StreamingLoggingConfig Prelude.Text
streamingLoggingConfig_bucket :: (Text -> f Text)
-> StreamingLoggingConfig -> f StreamingLoggingConfig
streamingLoggingConfig_bucket = (StreamingLoggingConfig -> Text)
-> (StreamingLoggingConfig -> Text -> StreamingLoggingConfig)
-> Lens StreamingLoggingConfig StreamingLoggingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingLoggingConfig' {Text
bucket :: Text
$sel:bucket:StreamingLoggingConfig' :: StreamingLoggingConfig -> Text
bucket} -> Text
bucket) (\s :: StreamingLoggingConfig
s@StreamingLoggingConfig' {} Text
a -> StreamingLoggingConfig
s {$sel:bucket:StreamingLoggingConfig' :: Text
bucket = Text
a} :: StreamingLoggingConfig)
streamingLoggingConfig_prefix :: Lens.Lens' StreamingLoggingConfig Prelude.Text
streamingLoggingConfig_prefix :: (Text -> f Text)
-> StreamingLoggingConfig -> f StreamingLoggingConfig
streamingLoggingConfig_prefix = (StreamingLoggingConfig -> Text)
-> (StreamingLoggingConfig -> Text -> StreamingLoggingConfig)
-> Lens StreamingLoggingConfig StreamingLoggingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingLoggingConfig' {Text
prefix :: Text
$sel:prefix:StreamingLoggingConfig' :: StreamingLoggingConfig -> Text
prefix} -> Text
prefix) (\s :: StreamingLoggingConfig
s@StreamingLoggingConfig' {} Text
a -> StreamingLoggingConfig
s {$sel:prefix:StreamingLoggingConfig' :: Text
prefix = Text
a} :: StreamingLoggingConfig)
instance Core.FromXML StreamingLoggingConfig where
parseXML :: [Node] -> Either String StreamingLoggingConfig
parseXML [Node]
x =
Bool -> Text -> Text -> StreamingLoggingConfig
StreamingLoggingConfig'
(Bool -> Text -> Text -> StreamingLoggingConfig)
-> Either String Bool
-> Either String (Text -> Text -> StreamingLoggingConfig)
forall (f :: * -> *) a b. Functor 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")
Either String (Text -> Text -> StreamingLoggingConfig)
-> Either String Text
-> Either String (Text -> StreamingLoggingConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Bucket")
Either String (Text -> StreamingLoggingConfig)
-> Either String Text -> Either String StreamingLoggingConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Prefix")
instance Prelude.Hashable StreamingLoggingConfig
instance Prelude.NFData StreamingLoggingConfig
instance Core.ToXML StreamingLoggingConfig where
toXML :: StreamingLoggingConfig -> XML
toXML StreamingLoggingConfig' {Bool
Text
prefix :: Text
bucket :: Text
enabled :: Bool
$sel:prefix:StreamingLoggingConfig' :: StreamingLoggingConfig -> Text
$sel:bucket:StreamingLoggingConfig' :: StreamingLoggingConfig -> Text
$sel:enabled:StreamingLoggingConfig' :: StreamingLoggingConfig -> Bool
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Enabled" Name -> Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Bool
enabled,
Name
"Bucket" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
bucket,
Name
"Prefix" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
prefix
]