{-# 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.Redshift.Types.LoggingStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
data LoggingStatus = LoggingStatus'
{
LoggingStatus -> Maybe ISO8601
lastFailureTime :: Prelude.Maybe Core.ISO8601,
LoggingStatus -> Maybe ISO8601
lastSuccessfulDeliveryTime :: Prelude.Maybe Core.ISO8601,
LoggingStatus -> Maybe Text
s3KeyPrefix :: Prelude.Maybe Prelude.Text,
LoggingStatus -> Maybe Text
bucketName :: Prelude.Maybe Prelude.Text,
LoggingStatus -> Maybe Bool
loggingEnabled :: Prelude.Maybe Prelude.Bool,
LoggingStatus -> Maybe Text
lastFailureMessage :: Prelude.Maybe Prelude.Text
}
deriving (LoggingStatus -> LoggingStatus -> Bool
(LoggingStatus -> LoggingStatus -> Bool)
-> (LoggingStatus -> LoggingStatus -> Bool) -> Eq LoggingStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoggingStatus -> LoggingStatus -> Bool
$c/= :: LoggingStatus -> LoggingStatus -> Bool
== :: LoggingStatus -> LoggingStatus -> Bool
$c== :: LoggingStatus -> LoggingStatus -> Bool
Prelude.Eq, ReadPrec [LoggingStatus]
ReadPrec LoggingStatus
Int -> ReadS LoggingStatus
ReadS [LoggingStatus]
(Int -> ReadS LoggingStatus)
-> ReadS [LoggingStatus]
-> ReadPrec LoggingStatus
-> ReadPrec [LoggingStatus]
-> Read LoggingStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoggingStatus]
$creadListPrec :: ReadPrec [LoggingStatus]
readPrec :: ReadPrec LoggingStatus
$creadPrec :: ReadPrec LoggingStatus
readList :: ReadS [LoggingStatus]
$creadList :: ReadS [LoggingStatus]
readsPrec :: Int -> ReadS LoggingStatus
$creadsPrec :: Int -> ReadS LoggingStatus
Prelude.Read, Int -> LoggingStatus -> ShowS
[LoggingStatus] -> ShowS
LoggingStatus -> String
(Int -> LoggingStatus -> ShowS)
-> (LoggingStatus -> String)
-> ([LoggingStatus] -> ShowS)
-> Show LoggingStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoggingStatus] -> ShowS
$cshowList :: [LoggingStatus] -> ShowS
show :: LoggingStatus -> String
$cshow :: LoggingStatus -> String
showsPrec :: Int -> LoggingStatus -> ShowS
$cshowsPrec :: Int -> LoggingStatus -> ShowS
Prelude.Show, (forall x. LoggingStatus -> Rep LoggingStatus x)
-> (forall x. Rep LoggingStatus x -> LoggingStatus)
-> Generic LoggingStatus
forall x. Rep LoggingStatus x -> LoggingStatus
forall x. LoggingStatus -> Rep LoggingStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoggingStatus x -> LoggingStatus
$cfrom :: forall x. LoggingStatus -> Rep LoggingStatus x
Prelude.Generic)
newLoggingStatus ::
LoggingStatus
newLoggingStatus :: LoggingStatus
newLoggingStatus =
LoggingStatus' :: Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> LoggingStatus
LoggingStatus'
{ $sel:lastFailureTime:LoggingStatus' :: Maybe ISO8601
lastFailureTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:lastSuccessfulDeliveryTime:LoggingStatus' :: Maybe ISO8601
lastSuccessfulDeliveryTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:s3KeyPrefix:LoggingStatus' :: Maybe Text
s3KeyPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucketName:LoggingStatus' :: Maybe Text
bucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:loggingEnabled:LoggingStatus' :: Maybe Bool
loggingEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:lastFailureMessage:LoggingStatus' :: Maybe Text
lastFailureMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
loggingStatus_lastFailureTime :: Lens.Lens' LoggingStatus (Prelude.Maybe Prelude.UTCTime)
loggingStatus_lastFailureTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LoggingStatus -> f LoggingStatus
loggingStatus_lastFailureTime = (LoggingStatus -> Maybe ISO8601)
-> (LoggingStatus -> Maybe ISO8601 -> LoggingStatus)
-> Lens LoggingStatus LoggingStatus (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingStatus' {Maybe ISO8601
lastFailureTime :: Maybe ISO8601
$sel:lastFailureTime:LoggingStatus' :: LoggingStatus -> Maybe ISO8601
lastFailureTime} -> Maybe ISO8601
lastFailureTime) (\s :: LoggingStatus
s@LoggingStatus' {} Maybe ISO8601
a -> LoggingStatus
s {$sel:lastFailureTime:LoggingStatus' :: Maybe ISO8601
lastFailureTime = Maybe ISO8601
a} :: LoggingStatus) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> LoggingStatus -> f LoggingStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LoggingStatus
-> f LoggingStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
loggingStatus_lastSuccessfulDeliveryTime :: Lens.Lens' LoggingStatus (Prelude.Maybe Prelude.UTCTime)
loggingStatus_lastSuccessfulDeliveryTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LoggingStatus -> f LoggingStatus
loggingStatus_lastSuccessfulDeliveryTime = (LoggingStatus -> Maybe ISO8601)
-> (LoggingStatus -> Maybe ISO8601 -> LoggingStatus)
-> Lens LoggingStatus LoggingStatus (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingStatus' {Maybe ISO8601
lastSuccessfulDeliveryTime :: Maybe ISO8601
$sel:lastSuccessfulDeliveryTime:LoggingStatus' :: LoggingStatus -> Maybe ISO8601
lastSuccessfulDeliveryTime} -> Maybe ISO8601
lastSuccessfulDeliveryTime) (\s :: LoggingStatus
s@LoggingStatus' {} Maybe ISO8601
a -> LoggingStatus
s {$sel:lastSuccessfulDeliveryTime:LoggingStatus' :: Maybe ISO8601
lastSuccessfulDeliveryTime = Maybe ISO8601
a} :: LoggingStatus) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> LoggingStatus -> f LoggingStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LoggingStatus
-> f LoggingStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
loggingStatus_s3KeyPrefix :: Lens.Lens' LoggingStatus (Prelude.Maybe Prelude.Text)
loggingStatus_s3KeyPrefix :: (Maybe Text -> f (Maybe Text)) -> LoggingStatus -> f LoggingStatus
loggingStatus_s3KeyPrefix = (LoggingStatus -> Maybe Text)
-> (LoggingStatus -> Maybe Text -> LoggingStatus)
-> Lens LoggingStatus LoggingStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingStatus' {Maybe Text
s3KeyPrefix :: Maybe Text
$sel:s3KeyPrefix:LoggingStatus' :: LoggingStatus -> Maybe Text
s3KeyPrefix} -> Maybe Text
s3KeyPrefix) (\s :: LoggingStatus
s@LoggingStatus' {} Maybe Text
a -> LoggingStatus
s {$sel:s3KeyPrefix:LoggingStatus' :: Maybe Text
s3KeyPrefix = Maybe Text
a} :: LoggingStatus)
loggingStatus_bucketName :: Lens.Lens' LoggingStatus (Prelude.Maybe Prelude.Text)
loggingStatus_bucketName :: (Maybe Text -> f (Maybe Text)) -> LoggingStatus -> f LoggingStatus
loggingStatus_bucketName = (LoggingStatus -> Maybe Text)
-> (LoggingStatus -> Maybe Text -> LoggingStatus)
-> Lens LoggingStatus LoggingStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingStatus' {Maybe Text
bucketName :: Maybe Text
$sel:bucketName:LoggingStatus' :: LoggingStatus -> Maybe Text
bucketName} -> Maybe Text
bucketName) (\s :: LoggingStatus
s@LoggingStatus' {} Maybe Text
a -> LoggingStatus
s {$sel:bucketName:LoggingStatus' :: Maybe Text
bucketName = Maybe Text
a} :: LoggingStatus)
loggingStatus_loggingEnabled :: Lens.Lens' LoggingStatus (Prelude.Maybe Prelude.Bool)
loggingStatus_loggingEnabled :: (Maybe Bool -> f (Maybe Bool)) -> LoggingStatus -> f LoggingStatus
loggingStatus_loggingEnabled = (LoggingStatus -> Maybe Bool)
-> (LoggingStatus -> Maybe Bool -> LoggingStatus)
-> Lens LoggingStatus LoggingStatus (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingStatus' {Maybe Bool
loggingEnabled :: Maybe Bool
$sel:loggingEnabled:LoggingStatus' :: LoggingStatus -> Maybe Bool
loggingEnabled} -> Maybe Bool
loggingEnabled) (\s :: LoggingStatus
s@LoggingStatus' {} Maybe Bool
a -> LoggingStatus
s {$sel:loggingEnabled:LoggingStatus' :: Maybe Bool
loggingEnabled = Maybe Bool
a} :: LoggingStatus)
loggingStatus_lastFailureMessage :: Lens.Lens' LoggingStatus (Prelude.Maybe Prelude.Text)
loggingStatus_lastFailureMessage :: (Maybe Text -> f (Maybe Text)) -> LoggingStatus -> f LoggingStatus
loggingStatus_lastFailureMessage = (LoggingStatus -> Maybe Text)
-> (LoggingStatus -> Maybe Text -> LoggingStatus)
-> Lens LoggingStatus LoggingStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingStatus' {Maybe Text
lastFailureMessage :: Maybe Text
$sel:lastFailureMessage:LoggingStatus' :: LoggingStatus -> Maybe Text
lastFailureMessage} -> Maybe Text
lastFailureMessage) (\s :: LoggingStatus
s@LoggingStatus' {} Maybe Text
a -> LoggingStatus
s {$sel:lastFailureMessage:LoggingStatus' :: Maybe Text
lastFailureMessage = Maybe Text
a} :: LoggingStatus)
instance Core.FromXML LoggingStatus where
parseXML :: [Node] -> Either String LoggingStatus
parseXML [Node]
x =
Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> LoggingStatus
LoggingStatus'
(Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> LoggingStatus)
-> Either String (Maybe ISO8601)
-> Either
String
(Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> LoggingStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastFailureTime")
Either
String
(Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> LoggingStatus)
-> Either String (Maybe ISO8601)
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> LoggingStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastSuccessfulDeliveryTime")
Either
String
(Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> LoggingStatus)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Bool -> Maybe Text -> LoggingStatus)
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
"S3KeyPrefix")
Either
String (Maybe Text -> Maybe Bool -> Maybe Text -> LoggingStatus)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> Maybe Text -> LoggingStatus)
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
"BucketName")
Either String (Maybe Bool -> Maybe Text -> LoggingStatus)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> LoggingStatus)
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
"LoggingEnabled")
Either String (Maybe Text -> LoggingStatus)
-> Either String (Maybe Text) -> Either String LoggingStatus
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
"LastFailureMessage")
instance Prelude.Hashable LoggingStatus
instance Prelude.NFData LoggingStatus