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

import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.Types.CloudTrailConfigurationResult
import Amazonka.GuardDuty.Types.DNSLogsConfigurationResult
import Amazonka.GuardDuty.Types.FlowLogsConfigurationResult
import Amazonka.GuardDuty.Types.S3LogsConfigurationResult
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information on the status of data sources for the detector.
--
-- /See:/ 'newDataSourceConfigurationsResult' smart constructor.
data DataSourceConfigurationsResult = DataSourceConfigurationsResult'
  { -- | An object that contains information on the status of CloudTrail as a
    -- data source.
    DataSourceConfigurationsResult -> CloudTrailConfigurationResult
cloudTrail :: CloudTrailConfigurationResult,
    -- | An object that contains information on the status of DNS logs as a data
    -- source.
    DataSourceConfigurationsResult -> DNSLogsConfigurationResult
dNSLogs :: DNSLogsConfigurationResult,
    -- | An object that contains information on the status of VPC flow logs as a
    -- data source.
    DataSourceConfigurationsResult -> FlowLogsConfigurationResult
flowLogs :: FlowLogsConfigurationResult,
    -- | An object that contains information on the status of S3 Data event logs
    -- as a data source.
    DataSourceConfigurationsResult -> S3LogsConfigurationResult
s3Logs :: S3LogsConfigurationResult
  }
  deriving (DataSourceConfigurationsResult
-> DataSourceConfigurationsResult -> Bool
(DataSourceConfigurationsResult
 -> DataSourceConfigurationsResult -> Bool)
-> (DataSourceConfigurationsResult
    -> DataSourceConfigurationsResult -> Bool)
-> Eq DataSourceConfigurationsResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataSourceConfigurationsResult
-> DataSourceConfigurationsResult -> Bool
$c/= :: DataSourceConfigurationsResult
-> DataSourceConfigurationsResult -> Bool
== :: DataSourceConfigurationsResult
-> DataSourceConfigurationsResult -> Bool
$c== :: DataSourceConfigurationsResult
-> DataSourceConfigurationsResult -> Bool
Prelude.Eq, ReadPrec [DataSourceConfigurationsResult]
ReadPrec DataSourceConfigurationsResult
Int -> ReadS DataSourceConfigurationsResult
ReadS [DataSourceConfigurationsResult]
(Int -> ReadS DataSourceConfigurationsResult)
-> ReadS [DataSourceConfigurationsResult]
-> ReadPrec DataSourceConfigurationsResult
-> ReadPrec [DataSourceConfigurationsResult]
-> Read DataSourceConfigurationsResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataSourceConfigurationsResult]
$creadListPrec :: ReadPrec [DataSourceConfigurationsResult]
readPrec :: ReadPrec DataSourceConfigurationsResult
$creadPrec :: ReadPrec DataSourceConfigurationsResult
readList :: ReadS [DataSourceConfigurationsResult]
$creadList :: ReadS [DataSourceConfigurationsResult]
readsPrec :: Int -> ReadS DataSourceConfigurationsResult
$creadsPrec :: Int -> ReadS DataSourceConfigurationsResult
Prelude.Read, Int -> DataSourceConfigurationsResult -> ShowS
[DataSourceConfigurationsResult] -> ShowS
DataSourceConfigurationsResult -> String
(Int -> DataSourceConfigurationsResult -> ShowS)
-> (DataSourceConfigurationsResult -> String)
-> ([DataSourceConfigurationsResult] -> ShowS)
-> Show DataSourceConfigurationsResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataSourceConfigurationsResult] -> ShowS
$cshowList :: [DataSourceConfigurationsResult] -> ShowS
show :: DataSourceConfigurationsResult -> String
$cshow :: DataSourceConfigurationsResult -> String
showsPrec :: Int -> DataSourceConfigurationsResult -> ShowS
$cshowsPrec :: Int -> DataSourceConfigurationsResult -> ShowS
Prelude.Show, (forall x.
 DataSourceConfigurationsResult
 -> Rep DataSourceConfigurationsResult x)
-> (forall x.
    Rep DataSourceConfigurationsResult x
    -> DataSourceConfigurationsResult)
-> Generic DataSourceConfigurationsResult
forall x.
Rep DataSourceConfigurationsResult x
-> DataSourceConfigurationsResult
forall x.
DataSourceConfigurationsResult
-> Rep DataSourceConfigurationsResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DataSourceConfigurationsResult x
-> DataSourceConfigurationsResult
$cfrom :: forall x.
DataSourceConfigurationsResult
-> Rep DataSourceConfigurationsResult x
Prelude.Generic)

-- |
-- Create a value of 'DataSourceConfigurationsResult' 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:
--
-- 'cloudTrail', 'dataSourceConfigurationsResult_cloudTrail' - An object that contains information on the status of CloudTrail as a
-- data source.
--
-- 'dNSLogs', 'dataSourceConfigurationsResult_dNSLogs' - An object that contains information on the status of DNS logs as a data
-- source.
--
-- 'flowLogs', 'dataSourceConfigurationsResult_flowLogs' - An object that contains information on the status of VPC flow logs as a
-- data source.
--
-- 's3Logs', 'dataSourceConfigurationsResult_s3Logs' - An object that contains information on the status of S3 Data event logs
-- as a data source.
newDataSourceConfigurationsResult ::
  -- | 'cloudTrail'
  CloudTrailConfigurationResult ->
  -- | 'dNSLogs'
  DNSLogsConfigurationResult ->
  -- | 'flowLogs'
  FlowLogsConfigurationResult ->
  -- | 's3Logs'
  S3LogsConfigurationResult ->
  DataSourceConfigurationsResult
newDataSourceConfigurationsResult :: CloudTrailConfigurationResult
-> DNSLogsConfigurationResult
-> FlowLogsConfigurationResult
-> S3LogsConfigurationResult
-> DataSourceConfigurationsResult
newDataSourceConfigurationsResult
  CloudTrailConfigurationResult
pCloudTrail_
  DNSLogsConfigurationResult
pDNSLogs_
  FlowLogsConfigurationResult
pFlowLogs_
  S3LogsConfigurationResult
pS3Logs_ =
    DataSourceConfigurationsResult' :: CloudTrailConfigurationResult
-> DNSLogsConfigurationResult
-> FlowLogsConfigurationResult
-> S3LogsConfigurationResult
-> DataSourceConfigurationsResult
DataSourceConfigurationsResult'
      { $sel:cloudTrail:DataSourceConfigurationsResult' :: CloudTrailConfigurationResult
cloudTrail =
          CloudTrailConfigurationResult
pCloudTrail_,
        $sel:dNSLogs:DataSourceConfigurationsResult' :: DNSLogsConfigurationResult
dNSLogs = DNSLogsConfigurationResult
pDNSLogs_,
        $sel:flowLogs:DataSourceConfigurationsResult' :: FlowLogsConfigurationResult
flowLogs = FlowLogsConfigurationResult
pFlowLogs_,
        $sel:s3Logs:DataSourceConfigurationsResult' :: S3LogsConfigurationResult
s3Logs = S3LogsConfigurationResult
pS3Logs_
      }

-- | An object that contains information on the status of CloudTrail as a
-- data source.
dataSourceConfigurationsResult_cloudTrail :: Lens.Lens' DataSourceConfigurationsResult CloudTrailConfigurationResult
dataSourceConfigurationsResult_cloudTrail :: (CloudTrailConfigurationResult -> f CloudTrailConfigurationResult)
-> DataSourceConfigurationsResult
-> f DataSourceConfigurationsResult
dataSourceConfigurationsResult_cloudTrail = (DataSourceConfigurationsResult -> CloudTrailConfigurationResult)
-> (DataSourceConfigurationsResult
    -> CloudTrailConfigurationResult -> DataSourceConfigurationsResult)
-> Lens
     DataSourceConfigurationsResult
     DataSourceConfigurationsResult
     CloudTrailConfigurationResult
     CloudTrailConfigurationResult
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceConfigurationsResult' {CloudTrailConfigurationResult
cloudTrail :: CloudTrailConfigurationResult
$sel:cloudTrail:DataSourceConfigurationsResult' :: DataSourceConfigurationsResult -> CloudTrailConfigurationResult
cloudTrail} -> CloudTrailConfigurationResult
cloudTrail) (\s :: DataSourceConfigurationsResult
s@DataSourceConfigurationsResult' {} CloudTrailConfigurationResult
a -> DataSourceConfigurationsResult
s {$sel:cloudTrail:DataSourceConfigurationsResult' :: CloudTrailConfigurationResult
cloudTrail = CloudTrailConfigurationResult
a} :: DataSourceConfigurationsResult)

-- | An object that contains information on the status of DNS logs as a data
-- source.
dataSourceConfigurationsResult_dNSLogs :: Lens.Lens' DataSourceConfigurationsResult DNSLogsConfigurationResult
dataSourceConfigurationsResult_dNSLogs :: (DNSLogsConfigurationResult -> f DNSLogsConfigurationResult)
-> DataSourceConfigurationsResult
-> f DataSourceConfigurationsResult
dataSourceConfigurationsResult_dNSLogs = (DataSourceConfigurationsResult -> DNSLogsConfigurationResult)
-> (DataSourceConfigurationsResult
    -> DNSLogsConfigurationResult -> DataSourceConfigurationsResult)
-> Lens
     DataSourceConfigurationsResult
     DataSourceConfigurationsResult
     DNSLogsConfigurationResult
     DNSLogsConfigurationResult
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceConfigurationsResult' {DNSLogsConfigurationResult
dNSLogs :: DNSLogsConfigurationResult
$sel:dNSLogs:DataSourceConfigurationsResult' :: DataSourceConfigurationsResult -> DNSLogsConfigurationResult
dNSLogs} -> DNSLogsConfigurationResult
dNSLogs) (\s :: DataSourceConfigurationsResult
s@DataSourceConfigurationsResult' {} DNSLogsConfigurationResult
a -> DataSourceConfigurationsResult
s {$sel:dNSLogs:DataSourceConfigurationsResult' :: DNSLogsConfigurationResult
dNSLogs = DNSLogsConfigurationResult
a} :: DataSourceConfigurationsResult)

-- | An object that contains information on the status of VPC flow logs as a
-- data source.
dataSourceConfigurationsResult_flowLogs :: Lens.Lens' DataSourceConfigurationsResult FlowLogsConfigurationResult
dataSourceConfigurationsResult_flowLogs :: (FlowLogsConfigurationResult -> f FlowLogsConfigurationResult)
-> DataSourceConfigurationsResult
-> f DataSourceConfigurationsResult
dataSourceConfigurationsResult_flowLogs = (DataSourceConfigurationsResult -> FlowLogsConfigurationResult)
-> (DataSourceConfigurationsResult
    -> FlowLogsConfigurationResult -> DataSourceConfigurationsResult)
-> Lens
     DataSourceConfigurationsResult
     DataSourceConfigurationsResult
     FlowLogsConfigurationResult
     FlowLogsConfigurationResult
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceConfigurationsResult' {FlowLogsConfigurationResult
flowLogs :: FlowLogsConfigurationResult
$sel:flowLogs:DataSourceConfigurationsResult' :: DataSourceConfigurationsResult -> FlowLogsConfigurationResult
flowLogs} -> FlowLogsConfigurationResult
flowLogs) (\s :: DataSourceConfigurationsResult
s@DataSourceConfigurationsResult' {} FlowLogsConfigurationResult
a -> DataSourceConfigurationsResult
s {$sel:flowLogs:DataSourceConfigurationsResult' :: FlowLogsConfigurationResult
flowLogs = FlowLogsConfigurationResult
a} :: DataSourceConfigurationsResult)

-- | An object that contains information on the status of S3 Data event logs
-- as a data source.
dataSourceConfigurationsResult_s3Logs :: Lens.Lens' DataSourceConfigurationsResult S3LogsConfigurationResult
dataSourceConfigurationsResult_s3Logs :: (S3LogsConfigurationResult -> f S3LogsConfigurationResult)
-> DataSourceConfigurationsResult
-> f DataSourceConfigurationsResult
dataSourceConfigurationsResult_s3Logs = (DataSourceConfigurationsResult -> S3LogsConfigurationResult)
-> (DataSourceConfigurationsResult
    -> S3LogsConfigurationResult -> DataSourceConfigurationsResult)
-> Lens
     DataSourceConfigurationsResult
     DataSourceConfigurationsResult
     S3LogsConfigurationResult
     S3LogsConfigurationResult
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceConfigurationsResult' {S3LogsConfigurationResult
s3Logs :: S3LogsConfigurationResult
$sel:s3Logs:DataSourceConfigurationsResult' :: DataSourceConfigurationsResult -> S3LogsConfigurationResult
s3Logs} -> S3LogsConfigurationResult
s3Logs) (\s :: DataSourceConfigurationsResult
s@DataSourceConfigurationsResult' {} S3LogsConfigurationResult
a -> DataSourceConfigurationsResult
s {$sel:s3Logs:DataSourceConfigurationsResult' :: S3LogsConfigurationResult
s3Logs = S3LogsConfigurationResult
a} :: DataSourceConfigurationsResult)

instance Core.FromJSON DataSourceConfigurationsResult where
  parseJSON :: Value -> Parser DataSourceConfigurationsResult
parseJSON =
    String
-> (Object -> Parser DataSourceConfigurationsResult)
-> Value
-> Parser DataSourceConfigurationsResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DataSourceConfigurationsResult"
      ( \Object
x ->
          CloudTrailConfigurationResult
-> DNSLogsConfigurationResult
-> FlowLogsConfigurationResult
-> S3LogsConfigurationResult
-> DataSourceConfigurationsResult
DataSourceConfigurationsResult'
            (CloudTrailConfigurationResult
 -> DNSLogsConfigurationResult
 -> FlowLogsConfigurationResult
 -> S3LogsConfigurationResult
 -> DataSourceConfigurationsResult)
-> Parser CloudTrailConfigurationResult
-> Parser
     (DNSLogsConfigurationResult
      -> FlowLogsConfigurationResult
      -> S3LogsConfigurationResult
      -> DataSourceConfigurationsResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser CloudTrailConfigurationResult
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"cloudTrail")
            Parser
  (DNSLogsConfigurationResult
   -> FlowLogsConfigurationResult
   -> S3LogsConfigurationResult
   -> DataSourceConfigurationsResult)
-> Parser DNSLogsConfigurationResult
-> Parser
     (FlowLogsConfigurationResult
      -> S3LogsConfigurationResult -> DataSourceConfigurationsResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DNSLogsConfigurationResult
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"dnsLogs")
            Parser
  (FlowLogsConfigurationResult
   -> S3LogsConfigurationResult -> DataSourceConfigurationsResult)
-> Parser FlowLogsConfigurationResult
-> Parser
     (S3LogsConfigurationResult -> DataSourceConfigurationsResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FlowLogsConfigurationResult
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"flowLogs")
            Parser
  (S3LogsConfigurationResult -> DataSourceConfigurationsResult)
-> Parser S3LogsConfigurationResult
-> Parser DataSourceConfigurationsResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser S3LogsConfigurationResult
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"s3Logs")
      )

instance
  Prelude.Hashable
    DataSourceConfigurationsResult

instance
  Prelude.NFData
    DataSourceConfigurationsResult