{-# 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.DNSLogsConfigurationResult
-- 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.DNSLogsConfigurationResult 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 DNS logs as a data source.
--
-- /See:/ 'newDNSLogsConfigurationResult' smart constructor.
data DNSLogsConfigurationResult = DNSLogsConfigurationResult'
  { -- | Denotes whether DNS logs is enabled as a data source.
    DNSLogsConfigurationResult -> DataSourceStatus
status :: DataSourceStatus
  }
  deriving (DNSLogsConfigurationResult -> DNSLogsConfigurationResult -> Bool
(DNSLogsConfigurationResult -> DNSLogsConfigurationResult -> Bool)
-> (DNSLogsConfigurationResult
    -> DNSLogsConfigurationResult -> Bool)
-> Eq DNSLogsConfigurationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DNSLogsConfigurationResult -> DNSLogsConfigurationResult -> Bool
$c/= :: DNSLogsConfigurationResult -> DNSLogsConfigurationResult -> Bool
== :: DNSLogsConfigurationResult -> DNSLogsConfigurationResult -> Bool
$c== :: DNSLogsConfigurationResult -> DNSLogsConfigurationResult -> Bool
Prelude.Eq, ReadPrec [DNSLogsConfigurationResult]
ReadPrec DNSLogsConfigurationResult
Int -> ReadS DNSLogsConfigurationResult
ReadS [DNSLogsConfigurationResult]
(Int -> ReadS DNSLogsConfigurationResult)
-> ReadS [DNSLogsConfigurationResult]
-> ReadPrec DNSLogsConfigurationResult
-> ReadPrec [DNSLogsConfigurationResult]
-> Read DNSLogsConfigurationResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DNSLogsConfigurationResult]
$creadListPrec :: ReadPrec [DNSLogsConfigurationResult]
readPrec :: ReadPrec DNSLogsConfigurationResult
$creadPrec :: ReadPrec DNSLogsConfigurationResult
readList :: ReadS [DNSLogsConfigurationResult]
$creadList :: ReadS [DNSLogsConfigurationResult]
readsPrec :: Int -> ReadS DNSLogsConfigurationResult
$creadsPrec :: Int -> ReadS DNSLogsConfigurationResult
Prelude.Read, Int -> DNSLogsConfigurationResult -> ShowS
[DNSLogsConfigurationResult] -> ShowS
DNSLogsConfigurationResult -> String
(Int -> DNSLogsConfigurationResult -> ShowS)
-> (DNSLogsConfigurationResult -> String)
-> ([DNSLogsConfigurationResult] -> ShowS)
-> Show DNSLogsConfigurationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DNSLogsConfigurationResult] -> ShowS
$cshowList :: [DNSLogsConfigurationResult] -> ShowS
show :: DNSLogsConfigurationResult -> String
$cshow :: DNSLogsConfigurationResult -> String
showsPrec :: Int -> DNSLogsConfigurationResult -> ShowS
$cshowsPrec :: Int -> DNSLogsConfigurationResult -> ShowS
Prelude.Show, (forall x.
 DNSLogsConfigurationResult -> Rep DNSLogsConfigurationResult x)
-> (forall x.
    Rep DNSLogsConfigurationResult x -> DNSLogsConfigurationResult)
-> Generic DNSLogsConfigurationResult
forall x.
Rep DNSLogsConfigurationResult x -> DNSLogsConfigurationResult
forall x.
DNSLogsConfigurationResult -> Rep DNSLogsConfigurationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DNSLogsConfigurationResult x -> DNSLogsConfigurationResult
$cfrom :: forall x.
DNSLogsConfigurationResult -> Rep DNSLogsConfigurationResult x
Prelude.Generic)

-- |
-- Create a value of 'DNSLogsConfigurationResult' 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', 'dNSLogsConfigurationResult_status' - Denotes whether DNS logs is enabled as a data source.
newDNSLogsConfigurationResult ::
  -- | 'status'
  DataSourceStatus ->
  DNSLogsConfigurationResult
newDNSLogsConfigurationResult :: DataSourceStatus -> DNSLogsConfigurationResult
newDNSLogsConfigurationResult DataSourceStatus
pStatus_ =
  DNSLogsConfigurationResult' :: DataSourceStatus -> DNSLogsConfigurationResult
DNSLogsConfigurationResult' {$sel:status:DNSLogsConfigurationResult' :: DataSourceStatus
status = DataSourceStatus
pStatus_}

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

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

instance Prelude.NFData DNSLogsConfigurationResult