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

-- | Describes whether Malware Protection will be enabled as a data source.
--
-- /See:/ 'newMalwareProtectionConfiguration' smart constructor.
data MalwareProtectionConfiguration = MalwareProtectionConfiguration'
  { -- | Describes the configuration of Malware Protection for EC2 instances with
    -- findings.
    MalwareProtectionConfiguration -> Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings :: Prelude.Maybe ScanEc2InstanceWithFindings
  }
  deriving (MalwareProtectionConfiguration
-> MalwareProtectionConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MalwareProtectionConfiguration
-> MalwareProtectionConfiguration -> Bool
$c/= :: MalwareProtectionConfiguration
-> MalwareProtectionConfiguration -> Bool
== :: MalwareProtectionConfiguration
-> MalwareProtectionConfiguration -> Bool
$c== :: MalwareProtectionConfiguration
-> MalwareProtectionConfiguration -> Bool
Prelude.Eq, ReadPrec [MalwareProtectionConfiguration]
ReadPrec MalwareProtectionConfiguration
Int -> ReadS MalwareProtectionConfiguration
ReadS [MalwareProtectionConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MalwareProtectionConfiguration]
$creadListPrec :: ReadPrec [MalwareProtectionConfiguration]
readPrec :: ReadPrec MalwareProtectionConfiguration
$creadPrec :: ReadPrec MalwareProtectionConfiguration
readList :: ReadS [MalwareProtectionConfiguration]
$creadList :: ReadS [MalwareProtectionConfiguration]
readsPrec :: Int -> ReadS MalwareProtectionConfiguration
$creadsPrec :: Int -> ReadS MalwareProtectionConfiguration
Prelude.Read, Int -> MalwareProtectionConfiguration -> ShowS
[MalwareProtectionConfiguration] -> ShowS
MalwareProtectionConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MalwareProtectionConfiguration] -> ShowS
$cshowList :: [MalwareProtectionConfiguration] -> ShowS
show :: MalwareProtectionConfiguration -> String
$cshow :: MalwareProtectionConfiguration -> String
showsPrec :: Int -> MalwareProtectionConfiguration -> ShowS
$cshowsPrec :: Int -> MalwareProtectionConfiguration -> ShowS
Prelude.Show, forall x.
Rep MalwareProtectionConfiguration x
-> MalwareProtectionConfiguration
forall x.
MalwareProtectionConfiguration
-> Rep MalwareProtectionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MalwareProtectionConfiguration x
-> MalwareProtectionConfiguration
$cfrom :: forall x.
MalwareProtectionConfiguration
-> Rep MalwareProtectionConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'MalwareProtectionConfiguration' 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:
--
-- 'scanEc2InstanceWithFindings', 'malwareProtectionConfiguration_scanEc2InstanceWithFindings' - Describes the configuration of Malware Protection for EC2 instances with
-- findings.
newMalwareProtectionConfiguration ::
  MalwareProtectionConfiguration
newMalwareProtectionConfiguration :: MalwareProtectionConfiguration
newMalwareProtectionConfiguration =
  MalwareProtectionConfiguration'
    { $sel:scanEc2InstanceWithFindings:MalwareProtectionConfiguration' :: Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the configuration of Malware Protection for EC2 instances with
-- findings.
malwareProtectionConfiguration_scanEc2InstanceWithFindings :: Lens.Lens' MalwareProtectionConfiguration (Prelude.Maybe ScanEc2InstanceWithFindings)
malwareProtectionConfiguration_scanEc2InstanceWithFindings :: Lens'
  MalwareProtectionConfiguration (Maybe ScanEc2InstanceWithFindings)
malwareProtectionConfiguration_scanEc2InstanceWithFindings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MalwareProtectionConfiguration' {Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings :: Maybe ScanEc2InstanceWithFindings
$sel:scanEc2InstanceWithFindings:MalwareProtectionConfiguration' :: MalwareProtectionConfiguration -> Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings} -> Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings) (\s :: MalwareProtectionConfiguration
s@MalwareProtectionConfiguration' {} Maybe ScanEc2InstanceWithFindings
a -> MalwareProtectionConfiguration
s {$sel:scanEc2InstanceWithFindings:MalwareProtectionConfiguration' :: Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings = Maybe ScanEc2InstanceWithFindings
a} :: MalwareProtectionConfiguration)

instance
  Prelude.Hashable
    MalwareProtectionConfiguration
  where
  hashWithSalt :: Int -> MalwareProtectionConfiguration -> Int
hashWithSalt
    Int
_salt
    MalwareProtectionConfiguration' {Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings :: Maybe ScanEc2InstanceWithFindings
$sel:scanEc2InstanceWithFindings:MalwareProtectionConfiguration' :: MalwareProtectionConfiguration -> Maybe ScanEc2InstanceWithFindings
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings

instance
  Prelude.NFData
    MalwareProtectionConfiguration
  where
  rnf :: MalwareProtectionConfiguration -> ()
rnf MalwareProtectionConfiguration' {Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings :: Maybe ScanEc2InstanceWithFindings
$sel:scanEc2InstanceWithFindings:MalwareProtectionConfiguration' :: MalwareProtectionConfiguration -> Maybe ScanEc2InstanceWithFindings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings

instance Data.ToJSON MalwareProtectionConfiguration where
  toJSON :: MalwareProtectionConfiguration -> Value
toJSON MalwareProtectionConfiguration' {Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings :: Maybe ScanEc2InstanceWithFindings
$sel:scanEc2InstanceWithFindings:MalwareProtectionConfiguration' :: MalwareProtectionConfiguration -> Maybe ScanEc2InstanceWithFindings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"scanEc2InstanceWithFindings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScanEc2InstanceWithFindings
scanEc2InstanceWithFindings
          ]
      )