{-# 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.OrganizationS3LogsConfigurationResult
-- 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.OrganizationS3LogsConfigurationResult 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 current configuration of S3 data event logs as a data source for the
-- organization.
--
-- /See:/ 'newOrganizationS3LogsConfigurationResult' smart constructor.
data OrganizationS3LogsConfigurationResult = OrganizationS3LogsConfigurationResult'
  { -- | A value that describes whether S3 data event logs are automatically
    -- enabled for new members of the organization.
    OrganizationS3LogsConfigurationResult -> Bool
autoEnable :: Prelude.Bool
  }
  deriving (OrganizationS3LogsConfigurationResult
-> OrganizationS3LogsConfigurationResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationS3LogsConfigurationResult
-> OrganizationS3LogsConfigurationResult -> Bool
$c/= :: OrganizationS3LogsConfigurationResult
-> OrganizationS3LogsConfigurationResult -> Bool
== :: OrganizationS3LogsConfigurationResult
-> OrganizationS3LogsConfigurationResult -> Bool
$c== :: OrganizationS3LogsConfigurationResult
-> OrganizationS3LogsConfigurationResult -> Bool
Prelude.Eq, ReadPrec [OrganizationS3LogsConfigurationResult]
ReadPrec OrganizationS3LogsConfigurationResult
Int -> ReadS OrganizationS3LogsConfigurationResult
ReadS [OrganizationS3LogsConfigurationResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationS3LogsConfigurationResult]
$creadListPrec :: ReadPrec [OrganizationS3LogsConfigurationResult]
readPrec :: ReadPrec OrganizationS3LogsConfigurationResult
$creadPrec :: ReadPrec OrganizationS3LogsConfigurationResult
readList :: ReadS [OrganizationS3LogsConfigurationResult]
$creadList :: ReadS [OrganizationS3LogsConfigurationResult]
readsPrec :: Int -> ReadS OrganizationS3LogsConfigurationResult
$creadsPrec :: Int -> ReadS OrganizationS3LogsConfigurationResult
Prelude.Read, Int -> OrganizationS3LogsConfigurationResult -> ShowS
[OrganizationS3LogsConfigurationResult] -> ShowS
OrganizationS3LogsConfigurationResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationS3LogsConfigurationResult] -> ShowS
$cshowList :: [OrganizationS3LogsConfigurationResult] -> ShowS
show :: OrganizationS3LogsConfigurationResult -> String
$cshow :: OrganizationS3LogsConfigurationResult -> String
showsPrec :: Int -> OrganizationS3LogsConfigurationResult -> ShowS
$cshowsPrec :: Int -> OrganizationS3LogsConfigurationResult -> ShowS
Prelude.Show, forall x.
Rep OrganizationS3LogsConfigurationResult x
-> OrganizationS3LogsConfigurationResult
forall x.
OrganizationS3LogsConfigurationResult
-> Rep OrganizationS3LogsConfigurationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OrganizationS3LogsConfigurationResult x
-> OrganizationS3LogsConfigurationResult
$cfrom :: forall x.
OrganizationS3LogsConfigurationResult
-> Rep OrganizationS3LogsConfigurationResult x
Prelude.Generic)

-- |
-- Create a value of 'OrganizationS3LogsConfigurationResult' 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:
--
-- 'autoEnable', 'organizationS3LogsConfigurationResult_autoEnable' - A value that describes whether S3 data event logs are automatically
-- enabled for new members of the organization.
newOrganizationS3LogsConfigurationResult ::
  -- | 'autoEnable'
  Prelude.Bool ->
  OrganizationS3LogsConfigurationResult
newOrganizationS3LogsConfigurationResult :: Bool -> OrganizationS3LogsConfigurationResult
newOrganizationS3LogsConfigurationResult Bool
pAutoEnable_ =
  OrganizationS3LogsConfigurationResult'
    { $sel:autoEnable:OrganizationS3LogsConfigurationResult' :: Bool
autoEnable =
        Bool
pAutoEnable_
    }

-- | A value that describes whether S3 data event logs are automatically
-- enabled for new members of the organization.
organizationS3LogsConfigurationResult_autoEnable :: Lens.Lens' OrganizationS3LogsConfigurationResult Prelude.Bool
organizationS3LogsConfigurationResult_autoEnable :: Lens' OrganizationS3LogsConfigurationResult Bool
organizationS3LogsConfigurationResult_autoEnable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationS3LogsConfigurationResult' {Bool
autoEnable :: Bool
$sel:autoEnable:OrganizationS3LogsConfigurationResult' :: OrganizationS3LogsConfigurationResult -> Bool
autoEnable} -> Bool
autoEnable) (\s :: OrganizationS3LogsConfigurationResult
s@OrganizationS3LogsConfigurationResult' {} Bool
a -> OrganizationS3LogsConfigurationResult
s {$sel:autoEnable:OrganizationS3LogsConfigurationResult' :: Bool
autoEnable = Bool
a} :: OrganizationS3LogsConfigurationResult)

instance
  Data.FromJSON
    OrganizationS3LogsConfigurationResult
  where
  parseJSON :: Value -> Parser OrganizationS3LogsConfigurationResult
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OrganizationS3LogsConfigurationResult"
      ( \Object
x ->
          Bool -> OrganizationS3LogsConfigurationResult
OrganizationS3LogsConfigurationResult'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"autoEnable")
      )

instance
  Prelude.Hashable
    OrganizationS3LogsConfigurationResult
  where
  hashWithSalt :: Int -> OrganizationS3LogsConfigurationResult -> Int
hashWithSalt
    Int
_salt
    OrganizationS3LogsConfigurationResult' {Bool
autoEnable :: Bool
$sel:autoEnable:OrganizationS3LogsConfigurationResult' :: OrganizationS3LogsConfigurationResult -> Bool
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
autoEnable

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