{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RDS.Types.DescribeDBLogFilesDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RDS.Types.DescribeDBLogFilesDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This data type is used as a response element to @DescribeDBLogFiles@.
--
-- /See:/ 'newDescribeDBLogFilesDetails' smart constructor.
data DescribeDBLogFilesDetails = DescribeDBLogFilesDetails'
  { -- | A POSIX timestamp when the last log entry was written.
    DescribeDBLogFilesDetails -> Maybe Integer
lastWritten :: Prelude.Maybe Prelude.Integer,
    -- | The size, in bytes, of the log file for the specified DB instance.
    DescribeDBLogFilesDetails -> Maybe Integer
size :: Prelude.Maybe Prelude.Integer,
    -- | The name of the log file for the specified DB instance.
    DescribeDBLogFilesDetails -> Maybe Text
logFileName :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeDBLogFilesDetails -> DescribeDBLogFilesDetails -> Bool
(DescribeDBLogFilesDetails -> DescribeDBLogFilesDetails -> Bool)
-> (DescribeDBLogFilesDetails -> DescribeDBLogFilesDetails -> Bool)
-> Eq DescribeDBLogFilesDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBLogFilesDetails -> DescribeDBLogFilesDetails -> Bool
$c/= :: DescribeDBLogFilesDetails -> DescribeDBLogFilesDetails -> Bool
== :: DescribeDBLogFilesDetails -> DescribeDBLogFilesDetails -> Bool
$c== :: DescribeDBLogFilesDetails -> DescribeDBLogFilesDetails -> Bool
Prelude.Eq, ReadPrec [DescribeDBLogFilesDetails]
ReadPrec DescribeDBLogFilesDetails
Int -> ReadS DescribeDBLogFilesDetails
ReadS [DescribeDBLogFilesDetails]
(Int -> ReadS DescribeDBLogFilesDetails)
-> ReadS [DescribeDBLogFilesDetails]
-> ReadPrec DescribeDBLogFilesDetails
-> ReadPrec [DescribeDBLogFilesDetails]
-> Read DescribeDBLogFilesDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBLogFilesDetails]
$creadListPrec :: ReadPrec [DescribeDBLogFilesDetails]
readPrec :: ReadPrec DescribeDBLogFilesDetails
$creadPrec :: ReadPrec DescribeDBLogFilesDetails
readList :: ReadS [DescribeDBLogFilesDetails]
$creadList :: ReadS [DescribeDBLogFilesDetails]
readsPrec :: Int -> ReadS DescribeDBLogFilesDetails
$creadsPrec :: Int -> ReadS DescribeDBLogFilesDetails
Prelude.Read, Int -> DescribeDBLogFilesDetails -> ShowS
[DescribeDBLogFilesDetails] -> ShowS
DescribeDBLogFilesDetails -> String
(Int -> DescribeDBLogFilesDetails -> ShowS)
-> (DescribeDBLogFilesDetails -> String)
-> ([DescribeDBLogFilesDetails] -> ShowS)
-> Show DescribeDBLogFilesDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBLogFilesDetails] -> ShowS
$cshowList :: [DescribeDBLogFilesDetails] -> ShowS
show :: DescribeDBLogFilesDetails -> String
$cshow :: DescribeDBLogFilesDetails -> String
showsPrec :: Int -> DescribeDBLogFilesDetails -> ShowS
$cshowsPrec :: Int -> DescribeDBLogFilesDetails -> ShowS
Prelude.Show, (forall x.
 DescribeDBLogFilesDetails -> Rep DescribeDBLogFilesDetails x)
-> (forall x.
    Rep DescribeDBLogFilesDetails x -> DescribeDBLogFilesDetails)
-> Generic DescribeDBLogFilesDetails
forall x.
Rep DescribeDBLogFilesDetails x -> DescribeDBLogFilesDetails
forall x.
DescribeDBLogFilesDetails -> Rep DescribeDBLogFilesDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBLogFilesDetails x -> DescribeDBLogFilesDetails
$cfrom :: forall x.
DescribeDBLogFilesDetails -> Rep DescribeDBLogFilesDetails x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBLogFilesDetails' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lastWritten', 'describeDBLogFilesDetails_lastWritten' - A POSIX timestamp when the last log entry was written.
--
-- 'size', 'describeDBLogFilesDetails_size' - The size, in bytes, of the log file for the specified DB instance.
--
-- 'logFileName', 'describeDBLogFilesDetails_logFileName' - The name of the log file for the specified DB instance.
newDescribeDBLogFilesDetails ::
  DescribeDBLogFilesDetails
newDescribeDBLogFilesDetails :: DescribeDBLogFilesDetails
newDescribeDBLogFilesDetails =
  DescribeDBLogFilesDetails' :: Maybe Integer
-> Maybe Integer -> Maybe Text -> DescribeDBLogFilesDetails
DescribeDBLogFilesDetails'
    { $sel:lastWritten:DescribeDBLogFilesDetails' :: Maybe Integer
lastWritten =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:size:DescribeDBLogFilesDetails' :: Maybe Integer
size = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:logFileName:DescribeDBLogFilesDetails' :: Maybe Text
logFileName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A POSIX timestamp when the last log entry was written.
describeDBLogFilesDetails_lastWritten :: Lens.Lens' DescribeDBLogFilesDetails (Prelude.Maybe Prelude.Integer)
describeDBLogFilesDetails_lastWritten :: (Maybe Integer -> f (Maybe Integer))
-> DescribeDBLogFilesDetails -> f DescribeDBLogFilesDetails
describeDBLogFilesDetails_lastWritten = (DescribeDBLogFilesDetails -> Maybe Integer)
-> (DescribeDBLogFilesDetails
    -> Maybe Integer -> DescribeDBLogFilesDetails)
-> Lens
     DescribeDBLogFilesDetails
     DescribeDBLogFilesDetails
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBLogFilesDetails' {Maybe Integer
lastWritten :: Maybe Integer
$sel:lastWritten:DescribeDBLogFilesDetails' :: DescribeDBLogFilesDetails -> Maybe Integer
lastWritten} -> Maybe Integer
lastWritten) (\s :: DescribeDBLogFilesDetails
s@DescribeDBLogFilesDetails' {} Maybe Integer
a -> DescribeDBLogFilesDetails
s {$sel:lastWritten:DescribeDBLogFilesDetails' :: Maybe Integer
lastWritten = Maybe Integer
a} :: DescribeDBLogFilesDetails)

-- | The size, in bytes, of the log file for the specified DB instance.
describeDBLogFilesDetails_size :: Lens.Lens' DescribeDBLogFilesDetails (Prelude.Maybe Prelude.Integer)
describeDBLogFilesDetails_size :: (Maybe Integer -> f (Maybe Integer))
-> DescribeDBLogFilesDetails -> f DescribeDBLogFilesDetails
describeDBLogFilesDetails_size = (DescribeDBLogFilesDetails -> Maybe Integer)
-> (DescribeDBLogFilesDetails
    -> Maybe Integer -> DescribeDBLogFilesDetails)
-> Lens
     DescribeDBLogFilesDetails
     DescribeDBLogFilesDetails
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBLogFilesDetails' {Maybe Integer
size :: Maybe Integer
$sel:size:DescribeDBLogFilesDetails' :: DescribeDBLogFilesDetails -> Maybe Integer
size} -> Maybe Integer
size) (\s :: DescribeDBLogFilesDetails
s@DescribeDBLogFilesDetails' {} Maybe Integer
a -> DescribeDBLogFilesDetails
s {$sel:size:DescribeDBLogFilesDetails' :: Maybe Integer
size = Maybe Integer
a} :: DescribeDBLogFilesDetails)

-- | The name of the log file for the specified DB instance.
describeDBLogFilesDetails_logFileName :: Lens.Lens' DescribeDBLogFilesDetails (Prelude.Maybe Prelude.Text)
describeDBLogFilesDetails_logFileName :: (Maybe Text -> f (Maybe Text))
-> DescribeDBLogFilesDetails -> f DescribeDBLogFilesDetails
describeDBLogFilesDetails_logFileName = (DescribeDBLogFilesDetails -> Maybe Text)
-> (DescribeDBLogFilesDetails
    -> Maybe Text -> DescribeDBLogFilesDetails)
-> Lens
     DescribeDBLogFilesDetails
     DescribeDBLogFilesDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBLogFilesDetails' {Maybe Text
logFileName :: Maybe Text
$sel:logFileName:DescribeDBLogFilesDetails' :: DescribeDBLogFilesDetails -> Maybe Text
logFileName} -> Maybe Text
logFileName) (\s :: DescribeDBLogFilesDetails
s@DescribeDBLogFilesDetails' {} Maybe Text
a -> DescribeDBLogFilesDetails
s {$sel:logFileName:DescribeDBLogFilesDetails' :: Maybe Text
logFileName = Maybe Text
a} :: DescribeDBLogFilesDetails)

instance Core.FromXML DescribeDBLogFilesDetails where
  parseXML :: [Node] -> Either String DescribeDBLogFilesDetails
parseXML [Node]
x =
    Maybe Integer
-> Maybe Integer -> Maybe Text -> DescribeDBLogFilesDetails
DescribeDBLogFilesDetails'
      (Maybe Integer
 -> Maybe Integer -> Maybe Text -> DescribeDBLogFilesDetails)
-> Either String (Maybe Integer)
-> Either
     String (Maybe Integer -> Maybe Text -> DescribeDBLogFilesDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastWritten")
      Either
  String (Maybe Integer -> Maybe Text -> DescribeDBLogFilesDetails)
-> Either String (Maybe Integer)
-> Either String (Maybe Text -> DescribeDBLogFilesDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Size")
      Either String (Maybe Text -> DescribeDBLogFilesDetails)
-> Either String (Maybe Text)
-> Either String DescribeDBLogFilesDetails
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
"LogFileName")

instance Prelude.Hashable DescribeDBLogFilesDetails

instance Prelude.NFData DescribeDBLogFilesDetails