{-# 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.SecurityHub.Types.AwsRdsPendingCloudWatchLogsExports
-- 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.SecurityHub.Types.AwsRdsPendingCloudWatchLogsExports where

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

-- | Identifies the log types to enable and disable.
--
-- /See:/ 'newAwsRdsPendingCloudWatchLogsExports' smart constructor.
data AwsRdsPendingCloudWatchLogsExports = AwsRdsPendingCloudWatchLogsExports'
  { -- | A list of log types that are being enabled.
    AwsRdsPendingCloudWatchLogsExports -> Maybe [Text]
logTypesToEnable :: Prelude.Maybe [Prelude.Text],
    -- | A list of log types that are being disabled.
    AwsRdsPendingCloudWatchLogsExports -> Maybe [Text]
logTypesToDisable :: Prelude.Maybe [Prelude.Text]
  }
  deriving (AwsRdsPendingCloudWatchLogsExports
-> AwsRdsPendingCloudWatchLogsExports -> Bool
(AwsRdsPendingCloudWatchLogsExports
 -> AwsRdsPendingCloudWatchLogsExports -> Bool)
-> (AwsRdsPendingCloudWatchLogsExports
    -> AwsRdsPendingCloudWatchLogsExports -> Bool)
-> Eq AwsRdsPendingCloudWatchLogsExports
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRdsPendingCloudWatchLogsExports
-> AwsRdsPendingCloudWatchLogsExports -> Bool
$c/= :: AwsRdsPendingCloudWatchLogsExports
-> AwsRdsPendingCloudWatchLogsExports -> Bool
== :: AwsRdsPendingCloudWatchLogsExports
-> AwsRdsPendingCloudWatchLogsExports -> Bool
$c== :: AwsRdsPendingCloudWatchLogsExports
-> AwsRdsPendingCloudWatchLogsExports -> Bool
Prelude.Eq, ReadPrec [AwsRdsPendingCloudWatchLogsExports]
ReadPrec AwsRdsPendingCloudWatchLogsExports
Int -> ReadS AwsRdsPendingCloudWatchLogsExports
ReadS [AwsRdsPendingCloudWatchLogsExports]
(Int -> ReadS AwsRdsPendingCloudWatchLogsExports)
-> ReadS [AwsRdsPendingCloudWatchLogsExports]
-> ReadPrec AwsRdsPendingCloudWatchLogsExports
-> ReadPrec [AwsRdsPendingCloudWatchLogsExports]
-> Read AwsRdsPendingCloudWatchLogsExports
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRdsPendingCloudWatchLogsExports]
$creadListPrec :: ReadPrec [AwsRdsPendingCloudWatchLogsExports]
readPrec :: ReadPrec AwsRdsPendingCloudWatchLogsExports
$creadPrec :: ReadPrec AwsRdsPendingCloudWatchLogsExports
readList :: ReadS [AwsRdsPendingCloudWatchLogsExports]
$creadList :: ReadS [AwsRdsPendingCloudWatchLogsExports]
readsPrec :: Int -> ReadS AwsRdsPendingCloudWatchLogsExports
$creadsPrec :: Int -> ReadS AwsRdsPendingCloudWatchLogsExports
Prelude.Read, Int -> AwsRdsPendingCloudWatchLogsExports -> ShowS
[AwsRdsPendingCloudWatchLogsExports] -> ShowS
AwsRdsPendingCloudWatchLogsExports -> String
(Int -> AwsRdsPendingCloudWatchLogsExports -> ShowS)
-> (AwsRdsPendingCloudWatchLogsExports -> String)
-> ([AwsRdsPendingCloudWatchLogsExports] -> ShowS)
-> Show AwsRdsPendingCloudWatchLogsExports
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRdsPendingCloudWatchLogsExports] -> ShowS
$cshowList :: [AwsRdsPendingCloudWatchLogsExports] -> ShowS
show :: AwsRdsPendingCloudWatchLogsExports -> String
$cshow :: AwsRdsPendingCloudWatchLogsExports -> String
showsPrec :: Int -> AwsRdsPendingCloudWatchLogsExports -> ShowS
$cshowsPrec :: Int -> AwsRdsPendingCloudWatchLogsExports -> ShowS
Prelude.Show, (forall x.
 AwsRdsPendingCloudWatchLogsExports
 -> Rep AwsRdsPendingCloudWatchLogsExports x)
-> (forall x.
    Rep AwsRdsPendingCloudWatchLogsExports x
    -> AwsRdsPendingCloudWatchLogsExports)
-> Generic AwsRdsPendingCloudWatchLogsExports
forall x.
Rep AwsRdsPendingCloudWatchLogsExports x
-> AwsRdsPendingCloudWatchLogsExports
forall x.
AwsRdsPendingCloudWatchLogsExports
-> Rep AwsRdsPendingCloudWatchLogsExports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRdsPendingCloudWatchLogsExports x
-> AwsRdsPendingCloudWatchLogsExports
$cfrom :: forall x.
AwsRdsPendingCloudWatchLogsExports
-> Rep AwsRdsPendingCloudWatchLogsExports x
Prelude.Generic)

-- |
-- Create a value of 'AwsRdsPendingCloudWatchLogsExports' 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', 'awsRdsPendingCloudWatchLogsExports_logTypesToEnable' - A list of log types that are being enabled.
--
-- 'logTypesToDisable', 'awsRdsPendingCloudWatchLogsExports_logTypesToDisable' - A list of log types that are being disabled.
newAwsRdsPendingCloudWatchLogsExports ::
  AwsRdsPendingCloudWatchLogsExports
newAwsRdsPendingCloudWatchLogsExports :: AwsRdsPendingCloudWatchLogsExports
newAwsRdsPendingCloudWatchLogsExports =
  AwsRdsPendingCloudWatchLogsExports' :: Maybe [Text] -> Maybe [Text] -> AwsRdsPendingCloudWatchLogsExports
AwsRdsPendingCloudWatchLogsExports'
    { $sel:logTypesToEnable:AwsRdsPendingCloudWatchLogsExports' :: Maybe [Text]
logTypesToEnable =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:logTypesToDisable:AwsRdsPendingCloudWatchLogsExports' :: Maybe [Text]
logTypesToDisable = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of log types that are being enabled.
awsRdsPendingCloudWatchLogsExports_logTypesToEnable :: Lens.Lens' AwsRdsPendingCloudWatchLogsExports (Prelude.Maybe [Prelude.Text])
awsRdsPendingCloudWatchLogsExports_logTypesToEnable :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsRdsPendingCloudWatchLogsExports
-> f AwsRdsPendingCloudWatchLogsExports
awsRdsPendingCloudWatchLogsExports_logTypesToEnable = (AwsRdsPendingCloudWatchLogsExports -> Maybe [Text])
-> (AwsRdsPendingCloudWatchLogsExports
    -> Maybe [Text] -> AwsRdsPendingCloudWatchLogsExports)
-> Lens
     AwsRdsPendingCloudWatchLogsExports
     AwsRdsPendingCloudWatchLogsExports
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsPendingCloudWatchLogsExports' {Maybe [Text]
logTypesToEnable :: Maybe [Text]
$sel:logTypesToEnable:AwsRdsPendingCloudWatchLogsExports' :: AwsRdsPendingCloudWatchLogsExports -> Maybe [Text]
logTypesToEnable} -> Maybe [Text]
logTypesToEnable) (\s :: AwsRdsPendingCloudWatchLogsExports
s@AwsRdsPendingCloudWatchLogsExports' {} Maybe [Text]
a -> AwsRdsPendingCloudWatchLogsExports
s {$sel:logTypesToEnable:AwsRdsPendingCloudWatchLogsExports' :: Maybe [Text]
logTypesToEnable = Maybe [Text]
a} :: AwsRdsPendingCloudWatchLogsExports) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsRdsPendingCloudWatchLogsExports
 -> f AwsRdsPendingCloudWatchLogsExports)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsRdsPendingCloudWatchLogsExports
-> f AwsRdsPendingCloudWatchLogsExports
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

-- | A list of log types that are being disabled.
awsRdsPendingCloudWatchLogsExports_logTypesToDisable :: Lens.Lens' AwsRdsPendingCloudWatchLogsExports (Prelude.Maybe [Prelude.Text])
awsRdsPendingCloudWatchLogsExports_logTypesToDisable :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsRdsPendingCloudWatchLogsExports
-> f AwsRdsPendingCloudWatchLogsExports
awsRdsPendingCloudWatchLogsExports_logTypesToDisable = (AwsRdsPendingCloudWatchLogsExports -> Maybe [Text])
-> (AwsRdsPendingCloudWatchLogsExports
    -> Maybe [Text] -> AwsRdsPendingCloudWatchLogsExports)
-> Lens
     AwsRdsPendingCloudWatchLogsExports
     AwsRdsPendingCloudWatchLogsExports
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsPendingCloudWatchLogsExports' {Maybe [Text]
logTypesToDisable :: Maybe [Text]
$sel:logTypesToDisable:AwsRdsPendingCloudWatchLogsExports' :: AwsRdsPendingCloudWatchLogsExports -> Maybe [Text]
logTypesToDisable} -> Maybe [Text]
logTypesToDisable) (\s :: AwsRdsPendingCloudWatchLogsExports
s@AwsRdsPendingCloudWatchLogsExports' {} Maybe [Text]
a -> AwsRdsPendingCloudWatchLogsExports
s {$sel:logTypesToDisable:AwsRdsPendingCloudWatchLogsExports' :: Maybe [Text]
logTypesToDisable = Maybe [Text]
a} :: AwsRdsPendingCloudWatchLogsExports) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsRdsPendingCloudWatchLogsExports
 -> f AwsRdsPendingCloudWatchLogsExports)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsRdsPendingCloudWatchLogsExports
-> f AwsRdsPendingCloudWatchLogsExports
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.FromJSON
    AwsRdsPendingCloudWatchLogsExports
  where
  parseJSON :: Value -> Parser AwsRdsPendingCloudWatchLogsExports
parseJSON =
    String
-> (Object -> Parser AwsRdsPendingCloudWatchLogsExports)
-> Value
-> Parser AwsRdsPendingCloudWatchLogsExports
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRdsPendingCloudWatchLogsExports"
      ( \Object
x ->
          Maybe [Text] -> Maybe [Text] -> AwsRdsPendingCloudWatchLogsExports
AwsRdsPendingCloudWatchLogsExports'
            (Maybe [Text]
 -> Maybe [Text] -> AwsRdsPendingCloudWatchLogsExports)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> AwsRdsPendingCloudWatchLogsExports)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LogTypesToEnable"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe [Text] -> AwsRdsPendingCloudWatchLogsExports)
-> Parser (Maybe [Text])
-> Parser AwsRdsPendingCloudWatchLogsExports
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LogTypesToDisable"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    AwsRdsPendingCloudWatchLogsExports

instance
  Prelude.NFData
    AwsRdsPendingCloudWatchLogsExports

instance
  Core.ToJSON
    AwsRdsPendingCloudWatchLogsExports
  where
  toJSON :: AwsRdsPendingCloudWatchLogsExports -> Value
toJSON AwsRdsPendingCloudWatchLogsExports' {Maybe [Text]
logTypesToDisable :: Maybe [Text]
logTypesToEnable :: Maybe [Text]
$sel:logTypesToDisable:AwsRdsPendingCloudWatchLogsExports' :: AwsRdsPendingCloudWatchLogsExports -> Maybe [Text]
$sel:logTypesToEnable:AwsRdsPendingCloudWatchLogsExports' :: AwsRdsPendingCloudWatchLogsExports -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LogTypesToEnable" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
logTypesToEnable,
            (Text
"LogTypesToDisable" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
logTypesToDisable
          ]
      )