{-# 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.PendingCloudwatchLogsExports
-- 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.PendingCloudwatchLogsExports where

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

-- | A list of the log types whose configuration is still pending. In other
-- words, these log types are in the process of being activated or
-- deactivated.
--
-- /See:/ 'newPendingCloudwatchLogsExports' smart constructor.
data PendingCloudwatchLogsExports = PendingCloudwatchLogsExports'
  { -- | Log types that are in the process of being deactivated. After they are
    -- deactivated, these log types aren\'t exported to CloudWatch Logs.
    PendingCloudwatchLogsExports -> Maybe [Text]
logTypesToEnable :: Prelude.Maybe [Prelude.Text],
    -- | Log types that are in the process of being enabled. After they are
    -- enabled, these log types are exported to CloudWatch Logs.
    PendingCloudwatchLogsExports -> Maybe [Text]
logTypesToDisable :: Prelude.Maybe [Prelude.Text]
  }
  deriving (PendingCloudwatchLogsExports
-> PendingCloudwatchLogsExports -> Bool
(PendingCloudwatchLogsExports
 -> PendingCloudwatchLogsExports -> Bool)
-> (PendingCloudwatchLogsExports
    -> PendingCloudwatchLogsExports -> Bool)
-> Eq PendingCloudwatchLogsExports
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PendingCloudwatchLogsExports
-> PendingCloudwatchLogsExports -> Bool
$c/= :: PendingCloudwatchLogsExports
-> PendingCloudwatchLogsExports -> Bool
== :: PendingCloudwatchLogsExports
-> PendingCloudwatchLogsExports -> Bool
$c== :: PendingCloudwatchLogsExports
-> PendingCloudwatchLogsExports -> Bool
Prelude.Eq, ReadPrec [PendingCloudwatchLogsExports]
ReadPrec PendingCloudwatchLogsExports
Int -> ReadS PendingCloudwatchLogsExports
ReadS [PendingCloudwatchLogsExports]
(Int -> ReadS PendingCloudwatchLogsExports)
-> ReadS [PendingCloudwatchLogsExports]
-> ReadPrec PendingCloudwatchLogsExports
-> ReadPrec [PendingCloudwatchLogsExports]
-> Read PendingCloudwatchLogsExports
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PendingCloudwatchLogsExports]
$creadListPrec :: ReadPrec [PendingCloudwatchLogsExports]
readPrec :: ReadPrec PendingCloudwatchLogsExports
$creadPrec :: ReadPrec PendingCloudwatchLogsExports
readList :: ReadS [PendingCloudwatchLogsExports]
$creadList :: ReadS [PendingCloudwatchLogsExports]
readsPrec :: Int -> ReadS PendingCloudwatchLogsExports
$creadsPrec :: Int -> ReadS PendingCloudwatchLogsExports
Prelude.Read, Int -> PendingCloudwatchLogsExports -> ShowS
[PendingCloudwatchLogsExports] -> ShowS
PendingCloudwatchLogsExports -> String
(Int -> PendingCloudwatchLogsExports -> ShowS)
-> (PendingCloudwatchLogsExports -> String)
-> ([PendingCloudwatchLogsExports] -> ShowS)
-> Show PendingCloudwatchLogsExports
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PendingCloudwatchLogsExports] -> ShowS
$cshowList :: [PendingCloudwatchLogsExports] -> ShowS
show :: PendingCloudwatchLogsExports -> String
$cshow :: PendingCloudwatchLogsExports -> String
showsPrec :: Int -> PendingCloudwatchLogsExports -> ShowS
$cshowsPrec :: Int -> PendingCloudwatchLogsExports -> ShowS
Prelude.Show, (forall x.
 PendingCloudwatchLogsExports -> Rep PendingCloudwatchLogsExports x)
-> (forall x.
    Rep PendingCloudwatchLogsExports x -> PendingCloudwatchLogsExports)
-> Generic PendingCloudwatchLogsExports
forall x.
Rep PendingCloudwatchLogsExports x -> PendingCloudwatchLogsExports
forall x.
PendingCloudwatchLogsExports -> Rep PendingCloudwatchLogsExports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PendingCloudwatchLogsExports x -> PendingCloudwatchLogsExports
$cfrom :: forall x.
PendingCloudwatchLogsExports -> Rep PendingCloudwatchLogsExports x
Prelude.Generic)

-- |
-- Create a value of 'PendingCloudwatchLogsExports' 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:
--
-- 'logTypesToEnable', 'pendingCloudwatchLogsExports_logTypesToEnable' - Log types that are in the process of being deactivated. After they are
-- deactivated, these log types aren\'t exported to CloudWatch Logs.
--
-- 'logTypesToDisable', 'pendingCloudwatchLogsExports_logTypesToDisable' - Log types that are in the process of being enabled. After they are
-- enabled, these log types are exported to CloudWatch Logs.
newPendingCloudwatchLogsExports ::
  PendingCloudwatchLogsExports
newPendingCloudwatchLogsExports :: PendingCloudwatchLogsExports
newPendingCloudwatchLogsExports =
  PendingCloudwatchLogsExports' :: Maybe [Text] -> Maybe [Text] -> PendingCloudwatchLogsExports
PendingCloudwatchLogsExports'
    { $sel:logTypesToEnable:PendingCloudwatchLogsExports' :: Maybe [Text]
logTypesToEnable =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:logTypesToDisable:PendingCloudwatchLogsExports' :: Maybe [Text]
logTypesToDisable = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | Log types that are in the process of being deactivated. After they are
-- deactivated, these log types aren\'t exported to CloudWatch Logs.
pendingCloudwatchLogsExports_logTypesToEnable :: Lens.Lens' PendingCloudwatchLogsExports (Prelude.Maybe [Prelude.Text])
pendingCloudwatchLogsExports_logTypesToEnable :: (Maybe [Text] -> f (Maybe [Text]))
-> PendingCloudwatchLogsExports -> f PendingCloudwatchLogsExports
pendingCloudwatchLogsExports_logTypesToEnable = (PendingCloudwatchLogsExports -> Maybe [Text])
-> (PendingCloudwatchLogsExports
    -> Maybe [Text] -> PendingCloudwatchLogsExports)
-> Lens
     PendingCloudwatchLogsExports
     PendingCloudwatchLogsExports
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingCloudwatchLogsExports' {Maybe [Text]
logTypesToEnable :: Maybe [Text]
$sel:logTypesToEnable:PendingCloudwatchLogsExports' :: PendingCloudwatchLogsExports -> Maybe [Text]
logTypesToEnable} -> Maybe [Text]
logTypesToEnable) (\s :: PendingCloudwatchLogsExports
s@PendingCloudwatchLogsExports' {} Maybe [Text]
a -> PendingCloudwatchLogsExports
s {$sel:logTypesToEnable:PendingCloudwatchLogsExports' :: Maybe [Text]
logTypesToEnable = Maybe [Text]
a} :: PendingCloudwatchLogsExports) ((Maybe [Text] -> f (Maybe [Text]))
 -> PendingCloudwatchLogsExports -> f PendingCloudwatchLogsExports)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PendingCloudwatchLogsExports
-> f PendingCloudwatchLogsExports
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Log types that are in the process of being enabled. After they are
-- enabled, these log types are exported to CloudWatch Logs.
pendingCloudwatchLogsExports_logTypesToDisable :: Lens.Lens' PendingCloudwatchLogsExports (Prelude.Maybe [Prelude.Text])
pendingCloudwatchLogsExports_logTypesToDisable :: (Maybe [Text] -> f (Maybe [Text]))
-> PendingCloudwatchLogsExports -> f PendingCloudwatchLogsExports
pendingCloudwatchLogsExports_logTypesToDisable = (PendingCloudwatchLogsExports -> Maybe [Text])
-> (PendingCloudwatchLogsExports
    -> Maybe [Text] -> PendingCloudwatchLogsExports)
-> Lens
     PendingCloudwatchLogsExports
     PendingCloudwatchLogsExports
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingCloudwatchLogsExports' {Maybe [Text]
logTypesToDisable :: Maybe [Text]
$sel:logTypesToDisable:PendingCloudwatchLogsExports' :: PendingCloudwatchLogsExports -> Maybe [Text]
logTypesToDisable} -> Maybe [Text]
logTypesToDisable) (\s :: PendingCloudwatchLogsExports
s@PendingCloudwatchLogsExports' {} Maybe [Text]
a -> PendingCloudwatchLogsExports
s {$sel:logTypesToDisable:PendingCloudwatchLogsExports' :: Maybe [Text]
logTypesToDisable = Maybe [Text]
a} :: PendingCloudwatchLogsExports) ((Maybe [Text] -> f (Maybe [Text]))
 -> PendingCloudwatchLogsExports -> f PendingCloudwatchLogsExports)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PendingCloudwatchLogsExports
-> f PendingCloudwatchLogsExports
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromXML PendingCloudwatchLogsExports where
  parseXML :: [Node] -> Either String PendingCloudwatchLogsExports
parseXML [Node]
x =
    Maybe [Text] -> Maybe [Text] -> PendingCloudwatchLogsExports
PendingCloudwatchLogsExports'
      (Maybe [Text] -> Maybe [Text] -> PendingCloudwatchLogsExports)
-> Either String (Maybe [Text])
-> Either String (Maybe [Text] -> PendingCloudwatchLogsExports)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LogTypesToEnable"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either String (Maybe [Text] -> PendingCloudwatchLogsExports)
-> Either String (Maybe [Text])
-> Either String PendingCloudwatchLogsExports
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LogTypesToDisable"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )

instance
  Prelude.Hashable
    PendingCloudwatchLogsExports

instance Prelude.NFData PendingCloudwatchLogsExports