{-# 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.CloudwatchLogsExportConfiguration
-- 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.CloudwatchLogsExportConfiguration 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

-- | The configuration setting for the log types to be enabled for export to
-- Amazon CloudWatch Logs for a specific instance or cluster.
--
-- The @EnableLogTypes@ and @DisableLogTypes@ arrays determine which logs
-- are exported (or not exported) to CloudWatch Logs. The values within
-- these arrays depend on the engine that is being used.
--
-- /See:/ 'newCloudwatchLogsExportConfiguration' smart constructor.
data CloudwatchLogsExportConfiguration = CloudwatchLogsExportConfiguration'
  { -- | The list of log types to disable.
    CloudwatchLogsExportConfiguration -> Maybe [Text]
disableLogTypes :: Prelude.Maybe [Prelude.Text],
    -- | The list of log types to enable.
    CloudwatchLogsExportConfiguration -> Maybe [Text]
enableLogTypes :: Prelude.Maybe [Prelude.Text]
  }
  deriving (CloudwatchLogsExportConfiguration
-> CloudwatchLogsExportConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudwatchLogsExportConfiguration
-> CloudwatchLogsExportConfiguration -> Bool
$c/= :: CloudwatchLogsExportConfiguration
-> CloudwatchLogsExportConfiguration -> Bool
== :: CloudwatchLogsExportConfiguration
-> CloudwatchLogsExportConfiguration -> Bool
$c== :: CloudwatchLogsExportConfiguration
-> CloudwatchLogsExportConfiguration -> Bool
Prelude.Eq, ReadPrec [CloudwatchLogsExportConfiguration]
ReadPrec CloudwatchLogsExportConfiguration
Int -> ReadS CloudwatchLogsExportConfiguration
ReadS [CloudwatchLogsExportConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudwatchLogsExportConfiguration]
$creadListPrec :: ReadPrec [CloudwatchLogsExportConfiguration]
readPrec :: ReadPrec CloudwatchLogsExportConfiguration
$creadPrec :: ReadPrec CloudwatchLogsExportConfiguration
readList :: ReadS [CloudwatchLogsExportConfiguration]
$creadList :: ReadS [CloudwatchLogsExportConfiguration]
readsPrec :: Int -> ReadS CloudwatchLogsExportConfiguration
$creadsPrec :: Int -> ReadS CloudwatchLogsExportConfiguration
Prelude.Read, Int -> CloudwatchLogsExportConfiguration -> ShowS
[CloudwatchLogsExportConfiguration] -> ShowS
CloudwatchLogsExportConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudwatchLogsExportConfiguration] -> ShowS
$cshowList :: [CloudwatchLogsExportConfiguration] -> ShowS
show :: CloudwatchLogsExportConfiguration -> String
$cshow :: CloudwatchLogsExportConfiguration -> String
showsPrec :: Int -> CloudwatchLogsExportConfiguration -> ShowS
$cshowsPrec :: Int -> CloudwatchLogsExportConfiguration -> ShowS
Prelude.Show, forall x.
Rep CloudwatchLogsExportConfiguration x
-> CloudwatchLogsExportConfiguration
forall x.
CloudwatchLogsExportConfiguration
-> Rep CloudwatchLogsExportConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudwatchLogsExportConfiguration x
-> CloudwatchLogsExportConfiguration
$cfrom :: forall x.
CloudwatchLogsExportConfiguration
-> Rep CloudwatchLogsExportConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CloudwatchLogsExportConfiguration' 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:
--
-- 'disableLogTypes', 'cloudwatchLogsExportConfiguration_disableLogTypes' - The list of log types to disable.
--
-- 'enableLogTypes', 'cloudwatchLogsExportConfiguration_enableLogTypes' - The list of log types to enable.
newCloudwatchLogsExportConfiguration ::
  CloudwatchLogsExportConfiguration
newCloudwatchLogsExportConfiguration :: CloudwatchLogsExportConfiguration
newCloudwatchLogsExportConfiguration =
  CloudwatchLogsExportConfiguration'
    { $sel:disableLogTypes:CloudwatchLogsExportConfiguration' :: Maybe [Text]
disableLogTypes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enableLogTypes:CloudwatchLogsExportConfiguration' :: Maybe [Text]
enableLogTypes = forall a. Maybe a
Prelude.Nothing
    }

-- | The list of log types to disable.
cloudwatchLogsExportConfiguration_disableLogTypes :: Lens.Lens' CloudwatchLogsExportConfiguration (Prelude.Maybe [Prelude.Text])
cloudwatchLogsExportConfiguration_disableLogTypes :: Lens' CloudwatchLogsExportConfiguration (Maybe [Text])
cloudwatchLogsExportConfiguration_disableLogTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudwatchLogsExportConfiguration' {Maybe [Text]
disableLogTypes :: Maybe [Text]
$sel:disableLogTypes:CloudwatchLogsExportConfiguration' :: CloudwatchLogsExportConfiguration -> Maybe [Text]
disableLogTypes} -> Maybe [Text]
disableLogTypes) (\s :: CloudwatchLogsExportConfiguration
s@CloudwatchLogsExportConfiguration' {} Maybe [Text]
a -> CloudwatchLogsExportConfiguration
s {$sel:disableLogTypes:CloudwatchLogsExportConfiguration' :: Maybe [Text]
disableLogTypes = Maybe [Text]
a} :: CloudwatchLogsExportConfiguration) 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

-- | The list of log types to enable.
cloudwatchLogsExportConfiguration_enableLogTypes :: Lens.Lens' CloudwatchLogsExportConfiguration (Prelude.Maybe [Prelude.Text])
cloudwatchLogsExportConfiguration_enableLogTypes :: Lens' CloudwatchLogsExportConfiguration (Maybe [Text])
cloudwatchLogsExportConfiguration_enableLogTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudwatchLogsExportConfiguration' {Maybe [Text]
enableLogTypes :: Maybe [Text]
$sel:enableLogTypes:CloudwatchLogsExportConfiguration' :: CloudwatchLogsExportConfiguration -> Maybe [Text]
enableLogTypes} -> Maybe [Text]
enableLogTypes) (\s :: CloudwatchLogsExportConfiguration
s@CloudwatchLogsExportConfiguration' {} Maybe [Text]
a -> CloudwatchLogsExportConfiguration
s {$sel:enableLogTypes:CloudwatchLogsExportConfiguration' :: Maybe [Text]
enableLogTypes = Maybe [Text]
a} :: CloudwatchLogsExportConfiguration) 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
  Prelude.Hashable
    CloudwatchLogsExportConfiguration
  where
  hashWithSalt :: Int -> CloudwatchLogsExportConfiguration -> Int
hashWithSalt
    Int
_salt
    CloudwatchLogsExportConfiguration' {Maybe [Text]
enableLogTypes :: Maybe [Text]
disableLogTypes :: Maybe [Text]
$sel:enableLogTypes:CloudwatchLogsExportConfiguration' :: CloudwatchLogsExportConfiguration -> Maybe [Text]
$sel:disableLogTypes:CloudwatchLogsExportConfiguration' :: CloudwatchLogsExportConfiguration -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
disableLogTypes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
enableLogTypes

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

instance
  Data.ToQuery
    CloudwatchLogsExportConfiguration
  where
  toQuery :: CloudwatchLogsExportConfiguration -> QueryString
toQuery CloudwatchLogsExportConfiguration' {Maybe [Text]
enableLogTypes :: Maybe [Text]
disableLogTypes :: Maybe [Text]
$sel:enableLogTypes:CloudwatchLogsExportConfiguration' :: CloudwatchLogsExportConfiguration -> Maybe [Text]
$sel:disableLogTypes:CloudwatchLogsExportConfiguration' :: CloudwatchLogsExportConfiguration -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"DisableLogTypes"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
disableLogTypes
            ),
        ByteString
"EnableLogTypes"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
enableLogTypes
            )
      ]