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

-- | 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
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]
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
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. 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' {$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 :: Lens' S3LogsConfiguration Bool
s3LogsConfiguration_enable = 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 where
  hashWithSalt :: Int -> S3LogsConfiguration -> Int
hashWithSalt Int
_salt S3LogsConfiguration' {Bool
enable :: Bool
$sel:enable:S3LogsConfiguration' :: S3LogsConfiguration -> Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enable

instance Prelude.NFData S3LogsConfiguration where
  rnf :: S3LogsConfiguration -> ()
rnf S3LogsConfiguration' {Bool
enable :: Bool
$sel:enable:S3LogsConfiguration' :: S3LogsConfiguration -> Bool
..} = forall a. NFData a => a -> ()
Prelude.rnf Bool
enable

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