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

-- |
-- Create a value of 'OrganizationS3LogsConfiguration' 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', 'organizationS3LogsConfiguration_autoEnable' - A value that contains information on whether S3 data event logs will be
-- enabled automatically as a data source for the organization.
newOrganizationS3LogsConfiguration ::
  -- | 'autoEnable'
  Prelude.Bool ->
  OrganizationS3LogsConfiguration
newOrganizationS3LogsConfiguration :: Bool -> OrganizationS3LogsConfiguration
newOrganizationS3LogsConfiguration Bool
pAutoEnable_ =
  OrganizationS3LogsConfiguration' :: Bool -> OrganizationS3LogsConfiguration
OrganizationS3LogsConfiguration'
    { $sel:autoEnable:OrganizationS3LogsConfiguration' :: Bool
autoEnable =
        Bool
pAutoEnable_
    }

-- | A value that contains information on whether S3 data event logs will be
-- enabled automatically as a data source for the organization.
organizationS3LogsConfiguration_autoEnable :: Lens.Lens' OrganizationS3LogsConfiguration Prelude.Bool
organizationS3LogsConfiguration_autoEnable :: (Bool -> f Bool)
-> OrganizationS3LogsConfiguration
-> f OrganizationS3LogsConfiguration
organizationS3LogsConfiguration_autoEnable = (OrganizationS3LogsConfiguration -> Bool)
-> (OrganizationS3LogsConfiguration
    -> Bool -> OrganizationS3LogsConfiguration)
-> Lens
     OrganizationS3LogsConfiguration
     OrganizationS3LogsConfiguration
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationS3LogsConfiguration' {Bool
autoEnable :: Bool
$sel:autoEnable:OrganizationS3LogsConfiguration' :: OrganizationS3LogsConfiguration -> Bool
autoEnable} -> Bool
autoEnable) (\s :: OrganizationS3LogsConfiguration
s@OrganizationS3LogsConfiguration' {} Bool
a -> OrganizationS3LogsConfiguration
s {$sel:autoEnable:OrganizationS3LogsConfiguration' :: Bool
autoEnable = Bool
a} :: OrganizationS3LogsConfiguration)

instance
  Prelude.Hashable
    OrganizationS3LogsConfiguration

instance
  Prelude.NFData
    OrganizationS3LogsConfiguration

instance Core.ToJSON OrganizationS3LogsConfiguration where
  toJSON :: OrganizationS3LogsConfiguration -> Value
toJSON OrganizationS3LogsConfiguration' {Bool
autoEnable :: Bool
$sel:autoEnable:OrganizationS3LogsConfiguration' :: OrganizationS3LogsConfiguration -> 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
"autoEnable" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
autoEnable)]
      )