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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'KubernetesAuditLogsConfiguration' 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:
--
-- 'enable', 'kubernetesAuditLogsConfiguration_enable' - The status of Kubernetes audit logs as a data source.
newKubernetesAuditLogsConfiguration ::
  -- | 'enable'
  Prelude.Bool ->
  KubernetesAuditLogsConfiguration
newKubernetesAuditLogsConfiguration :: Bool -> KubernetesAuditLogsConfiguration
newKubernetesAuditLogsConfiguration Bool
pEnable_ =
  KubernetesAuditLogsConfiguration'
    { $sel:enable:KubernetesAuditLogsConfiguration' :: Bool
enable =
        Bool
pEnable_
    }

-- | The status of Kubernetes audit logs as a data source.
kubernetesAuditLogsConfiguration_enable :: Lens.Lens' KubernetesAuditLogsConfiguration Prelude.Bool
kubernetesAuditLogsConfiguration_enable :: Lens' KubernetesAuditLogsConfiguration Bool
kubernetesAuditLogsConfiguration_enable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KubernetesAuditLogsConfiguration' {Bool
enable :: Bool
$sel:enable:KubernetesAuditLogsConfiguration' :: KubernetesAuditLogsConfiguration -> Bool
enable} -> Bool
enable) (\s :: KubernetesAuditLogsConfiguration
s@KubernetesAuditLogsConfiguration' {} Bool
a -> KubernetesAuditLogsConfiguration
s {$sel:enable:KubernetesAuditLogsConfiguration' :: Bool
enable = Bool
a} :: KubernetesAuditLogsConfiguration)

instance
  Prelude.Hashable
    KubernetesAuditLogsConfiguration
  where
  hashWithSalt :: Int -> KubernetesAuditLogsConfiguration -> Int
hashWithSalt
    Int
_salt
    KubernetesAuditLogsConfiguration' {Bool
enable :: Bool
$sel:enable:KubernetesAuditLogsConfiguration' :: KubernetesAuditLogsConfiguration -> Bool
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enable

instance
  Prelude.NFData
    KubernetesAuditLogsConfiguration
  where
  rnf :: KubernetesAuditLogsConfiguration -> ()
rnf KubernetesAuditLogsConfiguration' {Bool
enable :: Bool
$sel:enable:KubernetesAuditLogsConfiguration' :: KubernetesAuditLogsConfiguration -> Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Bool
enable

instance Data.ToJSON KubernetesAuditLogsConfiguration where
  toJSON :: KubernetesAuditLogsConfiguration -> Value
toJSON KubernetesAuditLogsConfiguration' {Bool
enable :: Bool
$sel:enable:KubernetesAuditLogsConfiguration' :: KubernetesAuditLogsConfiguration -> Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"enable" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enable)]
      )