{-# 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.KubernetesConfiguration
-- 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.KubernetesConfiguration 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.KubernetesAuditLogsConfiguration
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'KubernetesConfiguration' 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', 'kubernetesConfiguration_auditLogs' - The status of Kubernetes audit logs as a data source.
newKubernetesConfiguration ::
  -- | 'auditLogs'
  KubernetesAuditLogsConfiguration ->
  KubernetesConfiguration
newKubernetesConfiguration :: KubernetesAuditLogsConfiguration -> KubernetesConfiguration
newKubernetesConfiguration KubernetesAuditLogsConfiguration
pAuditLogs_ =
  KubernetesConfiguration' {$sel:auditLogs:KubernetesConfiguration' :: KubernetesAuditLogsConfiguration
auditLogs = KubernetesAuditLogsConfiguration
pAuditLogs_}

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

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

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

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