{-# 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.KubernetesConfigurationResult
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GuardDuty.Types.KubernetesConfigurationResult where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GuardDuty.Types.KubernetesAuditLogsConfigurationResult
import qualified Amazonka.Prelude as Prelude

-- | Describes whether any Kubernetes logs will be enabled as a data source.
--
-- /See:/ 'newKubernetesConfigurationResult' smart constructor.
data KubernetesConfigurationResult = KubernetesConfigurationResult'
  { -- | Describes whether Kubernetes audit logs are enabled as a data source.
    KubernetesConfigurationResult
-> KubernetesAuditLogsConfigurationResult
auditLogs :: KubernetesAuditLogsConfigurationResult
  }
  deriving (KubernetesConfigurationResult
-> KubernetesConfigurationResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KubernetesConfigurationResult
-> KubernetesConfigurationResult -> Bool
$c/= :: KubernetesConfigurationResult
-> KubernetesConfigurationResult -> Bool
== :: KubernetesConfigurationResult
-> KubernetesConfigurationResult -> Bool
$c== :: KubernetesConfigurationResult
-> KubernetesConfigurationResult -> Bool
Prelude.Eq, ReadPrec [KubernetesConfigurationResult]
ReadPrec KubernetesConfigurationResult
Int -> ReadS KubernetesConfigurationResult
ReadS [KubernetesConfigurationResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KubernetesConfigurationResult]
$creadListPrec :: ReadPrec [KubernetesConfigurationResult]
readPrec :: ReadPrec KubernetesConfigurationResult
$creadPrec :: ReadPrec KubernetesConfigurationResult
readList :: ReadS [KubernetesConfigurationResult]
$creadList :: ReadS [KubernetesConfigurationResult]
readsPrec :: Int -> ReadS KubernetesConfigurationResult
$creadsPrec :: Int -> ReadS KubernetesConfigurationResult
Prelude.Read, Int -> KubernetesConfigurationResult -> ShowS
[KubernetesConfigurationResult] -> ShowS
KubernetesConfigurationResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KubernetesConfigurationResult] -> ShowS
$cshowList :: [KubernetesConfigurationResult] -> ShowS
show :: KubernetesConfigurationResult -> String
$cshow :: KubernetesConfigurationResult -> String
showsPrec :: Int -> KubernetesConfigurationResult -> ShowS
$cshowsPrec :: Int -> KubernetesConfigurationResult -> ShowS
Prelude.Show, forall x.
Rep KubernetesConfigurationResult x
-> KubernetesConfigurationResult
forall x.
KubernetesConfigurationResult
-> Rep KubernetesConfigurationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KubernetesConfigurationResult x
-> KubernetesConfigurationResult
$cfrom :: forall x.
KubernetesConfigurationResult
-> Rep KubernetesConfigurationResult x
Prelude.Generic)

-- |
-- Create a value of 'KubernetesConfigurationResult' 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:
--
-- 'auditLogs', 'kubernetesConfigurationResult_auditLogs' - Describes whether Kubernetes audit logs are enabled as a data source.
newKubernetesConfigurationResult ::
  -- | 'auditLogs'
  KubernetesAuditLogsConfigurationResult ->
  KubernetesConfigurationResult
newKubernetesConfigurationResult :: KubernetesAuditLogsConfigurationResult
-> KubernetesConfigurationResult
newKubernetesConfigurationResult KubernetesAuditLogsConfigurationResult
pAuditLogs_ =
  KubernetesConfigurationResult'
    { $sel:auditLogs:KubernetesConfigurationResult' :: KubernetesAuditLogsConfigurationResult
auditLogs =
        KubernetesAuditLogsConfigurationResult
pAuditLogs_
    }

-- | Describes whether Kubernetes audit logs are enabled as a data source.
kubernetesConfigurationResult_auditLogs :: Lens.Lens' KubernetesConfigurationResult KubernetesAuditLogsConfigurationResult
kubernetesConfigurationResult_auditLogs :: Lens'
  KubernetesConfigurationResult
  KubernetesAuditLogsConfigurationResult
kubernetesConfigurationResult_auditLogs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KubernetesConfigurationResult' {KubernetesAuditLogsConfigurationResult
auditLogs :: KubernetesAuditLogsConfigurationResult
$sel:auditLogs:KubernetesConfigurationResult' :: KubernetesConfigurationResult
-> KubernetesAuditLogsConfigurationResult
auditLogs} -> KubernetesAuditLogsConfigurationResult
auditLogs) (\s :: KubernetesConfigurationResult
s@KubernetesConfigurationResult' {} KubernetesAuditLogsConfigurationResult
a -> KubernetesConfigurationResult
s {$sel:auditLogs:KubernetesConfigurationResult' :: KubernetesAuditLogsConfigurationResult
auditLogs = KubernetesAuditLogsConfigurationResult
a} :: KubernetesConfigurationResult)

instance Data.FromJSON KubernetesConfigurationResult where
  parseJSON :: Value -> Parser KubernetesConfigurationResult
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"KubernetesConfigurationResult"
      ( \Object
x ->
          KubernetesAuditLogsConfigurationResult
-> KubernetesConfigurationResult
KubernetesConfigurationResult'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"auditLogs")
      )

instance
  Prelude.Hashable
    KubernetesConfigurationResult
  where
  hashWithSalt :: Int -> KubernetesConfigurationResult -> Int
hashWithSalt Int
_salt KubernetesConfigurationResult' {KubernetesAuditLogsConfigurationResult
auditLogs :: KubernetesAuditLogsConfigurationResult
$sel:auditLogs:KubernetesConfigurationResult' :: KubernetesConfigurationResult
-> KubernetesAuditLogsConfigurationResult
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` KubernetesAuditLogsConfigurationResult
auditLogs

instance Prelude.NFData KubernetesConfigurationResult where
  rnf :: KubernetesConfigurationResult -> ()
rnf KubernetesConfigurationResult' {KubernetesAuditLogsConfigurationResult
auditLogs :: KubernetesAuditLogsConfigurationResult
$sel:auditLogs:KubernetesConfigurationResult' :: KubernetesConfigurationResult
-> KubernetesAuditLogsConfigurationResult
..} =
    forall a. NFData a => a -> ()
Prelude.rnf KubernetesAuditLogsConfigurationResult
auditLogs