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

import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.Types.OrganizationS3LogsConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that contains information on which data sources will be
-- configured to be automatically enabled for new members within the
-- organization.
--
-- /See:/ 'newOrganizationDataSourceConfigurations' smart constructor.
data OrganizationDataSourceConfigurations = OrganizationDataSourceConfigurations'
  { -- | Describes whether S3 data event logs are enabled for new members of the
    -- organization.
    OrganizationDataSourceConfigurations
-> Maybe OrganizationS3LogsConfiguration
s3Logs :: Prelude.Maybe OrganizationS3LogsConfiguration
  }
  deriving (OrganizationDataSourceConfigurations
-> OrganizationDataSourceConfigurations -> Bool
(OrganizationDataSourceConfigurations
 -> OrganizationDataSourceConfigurations -> Bool)
-> (OrganizationDataSourceConfigurations
    -> OrganizationDataSourceConfigurations -> Bool)
-> Eq OrganizationDataSourceConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationDataSourceConfigurations
-> OrganizationDataSourceConfigurations -> Bool
$c/= :: OrganizationDataSourceConfigurations
-> OrganizationDataSourceConfigurations -> Bool
== :: OrganizationDataSourceConfigurations
-> OrganizationDataSourceConfigurations -> Bool
$c== :: OrganizationDataSourceConfigurations
-> OrganizationDataSourceConfigurations -> Bool
Prelude.Eq, ReadPrec [OrganizationDataSourceConfigurations]
ReadPrec OrganizationDataSourceConfigurations
Int -> ReadS OrganizationDataSourceConfigurations
ReadS [OrganizationDataSourceConfigurations]
(Int -> ReadS OrganizationDataSourceConfigurations)
-> ReadS [OrganizationDataSourceConfigurations]
-> ReadPrec OrganizationDataSourceConfigurations
-> ReadPrec [OrganizationDataSourceConfigurations]
-> Read OrganizationDataSourceConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationDataSourceConfigurations]
$creadListPrec :: ReadPrec [OrganizationDataSourceConfigurations]
readPrec :: ReadPrec OrganizationDataSourceConfigurations
$creadPrec :: ReadPrec OrganizationDataSourceConfigurations
readList :: ReadS [OrganizationDataSourceConfigurations]
$creadList :: ReadS [OrganizationDataSourceConfigurations]
readsPrec :: Int -> ReadS OrganizationDataSourceConfigurations
$creadsPrec :: Int -> ReadS OrganizationDataSourceConfigurations
Prelude.Read, Int -> OrganizationDataSourceConfigurations -> ShowS
[OrganizationDataSourceConfigurations] -> ShowS
OrganizationDataSourceConfigurations -> String
(Int -> OrganizationDataSourceConfigurations -> ShowS)
-> (OrganizationDataSourceConfigurations -> String)
-> ([OrganizationDataSourceConfigurations] -> ShowS)
-> Show OrganizationDataSourceConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationDataSourceConfigurations] -> ShowS
$cshowList :: [OrganizationDataSourceConfigurations] -> ShowS
show :: OrganizationDataSourceConfigurations -> String
$cshow :: OrganizationDataSourceConfigurations -> String
showsPrec :: Int -> OrganizationDataSourceConfigurations -> ShowS
$cshowsPrec :: Int -> OrganizationDataSourceConfigurations -> ShowS
Prelude.Show, (forall x.
 OrganizationDataSourceConfigurations
 -> Rep OrganizationDataSourceConfigurations x)
-> (forall x.
    Rep OrganizationDataSourceConfigurations x
    -> OrganizationDataSourceConfigurations)
-> Generic OrganizationDataSourceConfigurations
forall x.
Rep OrganizationDataSourceConfigurations x
-> OrganizationDataSourceConfigurations
forall x.
OrganizationDataSourceConfigurations
-> Rep OrganizationDataSourceConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OrganizationDataSourceConfigurations x
-> OrganizationDataSourceConfigurations
$cfrom :: forall x.
OrganizationDataSourceConfigurations
-> Rep OrganizationDataSourceConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'OrganizationDataSourceConfigurations' 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:
--
-- 's3Logs', 'organizationDataSourceConfigurations_s3Logs' - Describes whether S3 data event logs are enabled for new members of the
-- organization.
newOrganizationDataSourceConfigurations ::
  OrganizationDataSourceConfigurations
newOrganizationDataSourceConfigurations :: OrganizationDataSourceConfigurations
newOrganizationDataSourceConfigurations =
  OrganizationDataSourceConfigurations' :: Maybe OrganizationS3LogsConfiguration
-> OrganizationDataSourceConfigurations
OrganizationDataSourceConfigurations'
    { $sel:s3Logs:OrganizationDataSourceConfigurations' :: Maybe OrganizationS3LogsConfiguration
s3Logs =
        Maybe OrganizationS3LogsConfiguration
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes whether S3 data event logs are enabled for new members of the
-- organization.
organizationDataSourceConfigurations_s3Logs :: Lens.Lens' OrganizationDataSourceConfigurations (Prelude.Maybe OrganizationS3LogsConfiguration)
organizationDataSourceConfigurations_s3Logs :: (Maybe OrganizationS3LogsConfiguration
 -> f (Maybe OrganizationS3LogsConfiguration))
-> OrganizationDataSourceConfigurations
-> f OrganizationDataSourceConfigurations
organizationDataSourceConfigurations_s3Logs = (OrganizationDataSourceConfigurations
 -> Maybe OrganizationS3LogsConfiguration)
-> (OrganizationDataSourceConfigurations
    -> Maybe OrganizationS3LogsConfiguration
    -> OrganizationDataSourceConfigurations)
-> Lens
     OrganizationDataSourceConfigurations
     OrganizationDataSourceConfigurations
     (Maybe OrganizationS3LogsConfiguration)
     (Maybe OrganizationS3LogsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationDataSourceConfigurations' {Maybe OrganizationS3LogsConfiguration
s3Logs :: Maybe OrganizationS3LogsConfiguration
$sel:s3Logs:OrganizationDataSourceConfigurations' :: OrganizationDataSourceConfigurations
-> Maybe OrganizationS3LogsConfiguration
s3Logs} -> Maybe OrganizationS3LogsConfiguration
s3Logs) (\s :: OrganizationDataSourceConfigurations
s@OrganizationDataSourceConfigurations' {} Maybe OrganizationS3LogsConfiguration
a -> OrganizationDataSourceConfigurations
s {$sel:s3Logs:OrganizationDataSourceConfigurations' :: Maybe OrganizationS3LogsConfiguration
s3Logs = Maybe OrganizationS3LogsConfiguration
a} :: OrganizationDataSourceConfigurations)

instance
  Prelude.Hashable
    OrganizationDataSourceConfigurations

instance
  Prelude.NFData
    OrganizationDataSourceConfigurations

instance
  Core.ToJSON
    OrganizationDataSourceConfigurations
  where
  toJSON :: OrganizationDataSourceConfigurations -> Value
toJSON OrganizationDataSourceConfigurations' {Maybe OrganizationS3LogsConfiguration
s3Logs :: Maybe OrganizationS3LogsConfiguration
$sel:s3Logs:OrganizationDataSourceConfigurations' :: OrganizationDataSourceConfigurations
-> Maybe OrganizationS3LogsConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"s3Logs" Text -> OrganizationS3LogsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OrganizationS3LogsConfiguration -> Pair)
-> Maybe OrganizationS3LogsConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OrganizationS3LogsConfiguration
s3Logs]
      )