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

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

-- | Contains information on the status of VPC flow logs as a data source.
--
-- /See:/ 'newFlowLogsConfigurationResult' smart constructor.
data FlowLogsConfigurationResult = FlowLogsConfigurationResult'
  { -- | Denotes whether VPC flow logs is enabled as a data source.
    FlowLogsConfigurationResult -> DataSourceStatus
status :: DataSourceStatus
  }
  deriving (FlowLogsConfigurationResult -> FlowLogsConfigurationResult -> Bool
(FlowLogsConfigurationResult
 -> FlowLogsConfigurationResult -> Bool)
-> (FlowLogsConfigurationResult
    -> FlowLogsConfigurationResult -> Bool)
-> Eq FlowLogsConfigurationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FlowLogsConfigurationResult -> FlowLogsConfigurationResult -> Bool
$c/= :: FlowLogsConfigurationResult -> FlowLogsConfigurationResult -> Bool
== :: FlowLogsConfigurationResult -> FlowLogsConfigurationResult -> Bool
$c== :: FlowLogsConfigurationResult -> FlowLogsConfigurationResult -> Bool
Prelude.Eq, ReadPrec [FlowLogsConfigurationResult]
ReadPrec FlowLogsConfigurationResult
Int -> ReadS FlowLogsConfigurationResult
ReadS [FlowLogsConfigurationResult]
(Int -> ReadS FlowLogsConfigurationResult)
-> ReadS [FlowLogsConfigurationResult]
-> ReadPrec FlowLogsConfigurationResult
-> ReadPrec [FlowLogsConfigurationResult]
-> Read FlowLogsConfigurationResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FlowLogsConfigurationResult]
$creadListPrec :: ReadPrec [FlowLogsConfigurationResult]
readPrec :: ReadPrec FlowLogsConfigurationResult
$creadPrec :: ReadPrec FlowLogsConfigurationResult
readList :: ReadS [FlowLogsConfigurationResult]
$creadList :: ReadS [FlowLogsConfigurationResult]
readsPrec :: Int -> ReadS FlowLogsConfigurationResult
$creadsPrec :: Int -> ReadS FlowLogsConfigurationResult
Prelude.Read, Int -> FlowLogsConfigurationResult -> ShowS
[FlowLogsConfigurationResult] -> ShowS
FlowLogsConfigurationResult -> String
(Int -> FlowLogsConfigurationResult -> ShowS)
-> (FlowLogsConfigurationResult -> String)
-> ([FlowLogsConfigurationResult] -> ShowS)
-> Show FlowLogsConfigurationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FlowLogsConfigurationResult] -> ShowS
$cshowList :: [FlowLogsConfigurationResult] -> ShowS
show :: FlowLogsConfigurationResult -> String
$cshow :: FlowLogsConfigurationResult -> String
showsPrec :: Int -> FlowLogsConfigurationResult -> ShowS
$cshowsPrec :: Int -> FlowLogsConfigurationResult -> ShowS
Prelude.Show, (forall x.
 FlowLogsConfigurationResult -> Rep FlowLogsConfigurationResult x)
-> (forall x.
    Rep FlowLogsConfigurationResult x -> FlowLogsConfigurationResult)
-> Generic FlowLogsConfigurationResult
forall x.
Rep FlowLogsConfigurationResult x -> FlowLogsConfigurationResult
forall x.
FlowLogsConfigurationResult -> Rep FlowLogsConfigurationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FlowLogsConfigurationResult x -> FlowLogsConfigurationResult
$cfrom :: forall x.
FlowLogsConfigurationResult -> Rep FlowLogsConfigurationResult x
Prelude.Generic)

-- |
-- Create a value of 'FlowLogsConfigurationResult' 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', 'flowLogsConfigurationResult_status' - Denotes whether VPC flow logs is enabled as a data source.
newFlowLogsConfigurationResult ::
  -- | 'status'
  DataSourceStatus ->
  FlowLogsConfigurationResult
newFlowLogsConfigurationResult :: DataSourceStatus -> FlowLogsConfigurationResult
newFlowLogsConfigurationResult DataSourceStatus
pStatus_ =
  FlowLogsConfigurationResult' :: DataSourceStatus -> FlowLogsConfigurationResult
FlowLogsConfigurationResult' {$sel:status:FlowLogsConfigurationResult' :: DataSourceStatus
status = DataSourceStatus
pStatus_}

-- | Denotes whether VPC flow logs is enabled as a data source.
flowLogsConfigurationResult_status :: Lens.Lens' FlowLogsConfigurationResult DataSourceStatus
flowLogsConfigurationResult_status :: (DataSourceStatus -> f DataSourceStatus)
-> FlowLogsConfigurationResult -> f FlowLogsConfigurationResult
flowLogsConfigurationResult_status = (FlowLogsConfigurationResult -> DataSourceStatus)
-> (FlowLogsConfigurationResult
    -> DataSourceStatus -> FlowLogsConfigurationResult)
-> Lens
     FlowLogsConfigurationResult
     FlowLogsConfigurationResult
     DataSourceStatus
     DataSourceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLogsConfigurationResult' {DataSourceStatus
status :: DataSourceStatus
$sel:status:FlowLogsConfigurationResult' :: FlowLogsConfigurationResult -> DataSourceStatus
status} -> DataSourceStatus
status) (\s :: FlowLogsConfigurationResult
s@FlowLogsConfigurationResult' {} DataSourceStatus
a -> FlowLogsConfigurationResult
s {$sel:status:FlowLogsConfigurationResult' :: DataSourceStatus
status = DataSourceStatus
a} :: FlowLogsConfigurationResult)

instance Core.FromJSON FlowLogsConfigurationResult where
  parseJSON :: Value -> Parser FlowLogsConfigurationResult
parseJSON =
    String
-> (Object -> Parser FlowLogsConfigurationResult)
-> Value
-> Parser FlowLogsConfigurationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FlowLogsConfigurationResult"
      ( \Object
x ->
          DataSourceStatus -> FlowLogsConfigurationResult
FlowLogsConfigurationResult'
            (DataSourceStatus -> FlowLogsConfigurationResult)
-> Parser DataSourceStatus -> Parser FlowLogsConfigurationResult
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 FlowLogsConfigurationResult

instance Prelude.NFData FlowLogsConfigurationResult