{-# 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.DocumentDB.Types.PendingCloudwatchLogsExports
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DocumentDB.Types.PendingCloudwatchLogsExports where

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

-- | A list of the log types whose configuration is still pending. 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 enabled. After they are
    -- enabled, these log types are exported to Amazon CloudWatch Logs.
    PendingCloudwatchLogsExports -> Maybe [Text]
logTypesToDisable :: Prelude.Maybe [Prelude.Text],
    -- | 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]
  }
  deriving (PendingCloudwatchLogsExports
-> PendingCloudwatchLogsExports -> Bool
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]
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
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.
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:
--
-- 'logTypesToDisable', 'pendingCloudwatchLogsExports_logTypesToDisable' - Log types that are in the process of being enabled. After they are
-- enabled, these log types are exported to Amazon CloudWatch Logs.
--
-- '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.
newPendingCloudwatchLogsExports ::
  PendingCloudwatchLogsExports
newPendingCloudwatchLogsExports :: PendingCloudwatchLogsExports
newPendingCloudwatchLogsExports =
  PendingCloudwatchLogsExports'
    { $sel:logTypesToDisable:PendingCloudwatchLogsExports' :: Maybe [Text]
logTypesToDisable =
        forall a. Maybe a
Prelude.Nothing,
      $sel:logTypesToEnable:PendingCloudwatchLogsExports' :: Maybe [Text]
logTypesToEnable = forall a. Maybe a
Prelude.Nothing
    }

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

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

instance
  Prelude.Hashable
    PendingCloudwatchLogsExports
  where
  hashWithSalt :: Int -> PendingCloudwatchLogsExports -> Int
hashWithSalt Int
_salt PendingCloudwatchLogsExports' {Maybe [Text]
logTypesToEnable :: Maybe [Text]
logTypesToDisable :: Maybe [Text]
$sel:logTypesToEnable:PendingCloudwatchLogsExports' :: PendingCloudwatchLogsExports -> Maybe [Text]
$sel:logTypesToDisable:PendingCloudwatchLogsExports' :: PendingCloudwatchLogsExports -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
logTypesToDisable
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
logTypesToEnable

instance Prelude.NFData PendingCloudwatchLogsExports where
  rnf :: PendingCloudwatchLogsExports -> ()
rnf PendingCloudwatchLogsExports' {Maybe [Text]
logTypesToEnable :: Maybe [Text]
logTypesToDisable :: Maybe [Text]
$sel:logTypesToEnable:PendingCloudwatchLogsExports' :: PendingCloudwatchLogsExports -> Maybe [Text]
$sel:logTypesToDisable:PendingCloudwatchLogsExports' :: PendingCloudwatchLogsExports -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
logTypesToDisable
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
logTypesToEnable