{-# 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.GuardDuty.Types.S3LogsConfiguration
-- 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.GuardDuty.Types.S3LogsConfiguration where

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

-- | Describes whether S3 data event logs will be enabled as a data source.
--
-- /See:/ 'newS3LogsConfiguration' smart constructor.
data S3LogsConfiguration = S3LogsConfiguration'
  { -- | The status of S3 data event logs as a data source.
    S3LogsConfiguration -> Bool
enable :: Prelude.Bool
  }
  deriving (S3LogsConfiguration -> S3LogsConfiguration -> Bool
(S3LogsConfiguration -> S3LogsConfiguration -> Bool)
-> (S3LogsConfiguration -> S3LogsConfiguration -> Bool)
-> Eq S3LogsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3LogsConfiguration -> S3LogsConfiguration -> Bool
$c/= :: S3LogsConfiguration -> S3LogsConfiguration -> Bool
== :: S3LogsConfiguration -> S3LogsConfiguration -> Bool
$c== :: S3LogsConfiguration -> S3LogsConfiguration -> Bool
Prelude.Eq, ReadPrec [S3LogsConfiguration]
ReadPrec S3LogsConfiguration
Int -> ReadS S3LogsConfiguration
ReadS [S3LogsConfiguration]
(Int -> ReadS S3LogsConfiguration)
-> ReadS [S3LogsConfiguration]
-> ReadPrec S3LogsConfiguration
-> ReadPrec [S3LogsConfiguration]
-> Read S3LogsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3LogsConfiguration]
$creadListPrec :: ReadPrec [S3LogsConfiguration]
readPrec :: ReadPrec S3LogsConfiguration
$creadPrec :: ReadPrec S3LogsConfiguration
readList :: ReadS [S3LogsConfiguration]
$creadList :: ReadS [S3LogsConfiguration]
readsPrec :: Int -> ReadS S3LogsConfiguration
$creadsPrec :: Int -> ReadS S3LogsConfiguration
Prelude.Read, Int -> S3LogsConfiguration -> ShowS
[S3LogsConfiguration] -> ShowS
S3LogsConfiguration -> String
(Int -> S3LogsConfiguration -> ShowS)
-> (S3LogsConfiguration -> String)
-> ([S3LogsConfiguration] -> ShowS)
-> Show S3LogsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3LogsConfiguration] -> ShowS
$cshowList :: [S3LogsConfiguration] -> ShowS
show :: S3LogsConfiguration -> String
$cshow :: S3LogsConfiguration -> String
showsPrec :: Int -> S3LogsConfiguration -> ShowS
$cshowsPrec :: Int -> S3LogsConfiguration -> ShowS
Prelude.Show, (forall x. S3LogsConfiguration -> Rep S3LogsConfiguration x)
-> (forall x. Rep S3LogsConfiguration x -> S3LogsConfiguration)
-> Generic S3LogsConfiguration
forall x. Rep S3LogsConfiguration x -> S3LogsConfiguration
forall x. S3LogsConfiguration -> Rep S3LogsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3LogsConfiguration x -> S3LogsConfiguration
$cfrom :: forall x. S3LogsConfiguration -> Rep S3LogsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'S3LogsConfiguration' 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:
--
-- 'enable', 's3LogsConfiguration_enable' - The status of S3 data event logs as a data source.
newS3LogsConfiguration ::
  -- | 'enable'
  Prelude.Bool ->
  S3LogsConfiguration
newS3LogsConfiguration :: Bool -> S3LogsConfiguration
newS3LogsConfiguration Bool
pEnable_ =
  S3LogsConfiguration' :: Bool -> S3LogsConfiguration
S3LogsConfiguration' {$sel:enable:S3LogsConfiguration' :: Bool
enable = Bool
pEnable_}

-- | The status of S3 data event logs as a data source.
s3LogsConfiguration_enable :: Lens.Lens' S3LogsConfiguration Prelude.Bool
s3LogsConfiguration_enable :: (Bool -> f Bool) -> S3LogsConfiguration -> f S3LogsConfiguration
s3LogsConfiguration_enable = (S3LogsConfiguration -> Bool)
-> (S3LogsConfiguration -> Bool -> S3LogsConfiguration)
-> Lens S3LogsConfiguration S3LogsConfiguration Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogsConfiguration' {Bool
enable :: Bool
$sel:enable:S3LogsConfiguration' :: S3LogsConfiguration -> Bool
enable} -> Bool
enable) (\s :: S3LogsConfiguration
s@S3LogsConfiguration' {} Bool
a -> S3LogsConfiguration
s {$sel:enable:S3LogsConfiguration' :: Bool
enable = Bool
a} :: S3LogsConfiguration)

instance Prelude.Hashable S3LogsConfiguration

instance Prelude.NFData S3LogsConfiguration

instance Core.ToJSON S3LogsConfiguration where
  toJSON :: S3LogsConfiguration -> Value
toJSON S3LogsConfiguration' {Bool
enable :: Bool
$sel:enable:S3LogsConfiguration' :: S3LogsConfiguration -> Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"enable" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
enable)]
      )