{-# 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.S3LogsConfigurationResult
-- 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.S3LogsConfigurationResult where

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

-- |
-- Create a value of 'S3LogsConfigurationResult' 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:
--
-- 'status', 's3LogsConfigurationResult_status' - A value that describes whether S3 data event logs are automatically
-- enabled for new members of the organization.
newS3LogsConfigurationResult ::
  -- | 'status'
  DataSourceStatus ->
  S3LogsConfigurationResult
newS3LogsConfigurationResult :: DataSourceStatus -> S3LogsConfigurationResult
newS3LogsConfigurationResult DataSourceStatus
pStatus_ =
  S3LogsConfigurationResult' :: DataSourceStatus -> S3LogsConfigurationResult
S3LogsConfigurationResult' {$sel:status:S3LogsConfigurationResult' :: DataSourceStatus
status = DataSourceStatus
pStatus_}

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

instance Core.FromJSON S3LogsConfigurationResult where
  parseJSON :: Value -> Parser S3LogsConfigurationResult
parseJSON =
    String
-> (Object -> Parser S3LogsConfigurationResult)
-> Value
-> Parser S3LogsConfigurationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"S3LogsConfigurationResult"
      ( \Object
x ->
          DataSourceStatus -> S3LogsConfigurationResult
S3LogsConfigurationResult'
            (DataSourceStatus -> S3LogsConfigurationResult)
-> Parser DataSourceStatus -> Parser S3LogsConfigurationResult
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser DataSourceStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
      )

instance Prelude.Hashable S3LogsConfigurationResult

instance Prelude.NFData S3LogsConfigurationResult