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

-- | Contains details from the malware scan that created a finding.
--
-- /See:/ 'newEbsVolumeScanDetails' smart constructor.
data EbsVolumeScanDetails = EbsVolumeScanDetails'
  { -- | Returns the completion date and time of the malware scan.
    EbsVolumeScanDetails -> Maybe POSIX
scanCompletedAt :: Prelude.Maybe Data.POSIX,
    -- | Contains a complete view providing malware scan result details.
    EbsVolumeScanDetails -> Maybe ScanDetections
scanDetections :: Prelude.Maybe ScanDetections,
    -- | Unique Id of the malware scan that generated the finding.
    EbsVolumeScanDetails -> Maybe Text
scanId :: Prelude.Maybe Prelude.Text,
    -- | Returns the start date and time of the malware scan.
    EbsVolumeScanDetails -> Maybe POSIX
scanStartedAt :: Prelude.Maybe Data.POSIX,
    -- | Contains list of threat intelligence sources used to detect threats.
    EbsVolumeScanDetails -> Maybe [Text]
sources :: Prelude.Maybe [Prelude.Text],
    -- | GuardDuty finding ID that triggered a malware scan.
    EbsVolumeScanDetails -> Maybe Text
triggerFindingId :: Prelude.Maybe Prelude.Text
  }
  deriving (EbsVolumeScanDetails -> EbsVolumeScanDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EbsVolumeScanDetails -> EbsVolumeScanDetails -> Bool
$c/= :: EbsVolumeScanDetails -> EbsVolumeScanDetails -> Bool
== :: EbsVolumeScanDetails -> EbsVolumeScanDetails -> Bool
$c== :: EbsVolumeScanDetails -> EbsVolumeScanDetails -> Bool
Prelude.Eq, ReadPrec [EbsVolumeScanDetails]
ReadPrec EbsVolumeScanDetails
Int -> ReadS EbsVolumeScanDetails
ReadS [EbsVolumeScanDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EbsVolumeScanDetails]
$creadListPrec :: ReadPrec [EbsVolumeScanDetails]
readPrec :: ReadPrec EbsVolumeScanDetails
$creadPrec :: ReadPrec EbsVolumeScanDetails
readList :: ReadS [EbsVolumeScanDetails]
$creadList :: ReadS [EbsVolumeScanDetails]
readsPrec :: Int -> ReadS EbsVolumeScanDetails
$creadsPrec :: Int -> ReadS EbsVolumeScanDetails
Prelude.Read, Int -> EbsVolumeScanDetails -> ShowS
[EbsVolumeScanDetails] -> ShowS
EbsVolumeScanDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EbsVolumeScanDetails] -> ShowS
$cshowList :: [EbsVolumeScanDetails] -> ShowS
show :: EbsVolumeScanDetails -> String
$cshow :: EbsVolumeScanDetails -> String
showsPrec :: Int -> EbsVolumeScanDetails -> ShowS
$cshowsPrec :: Int -> EbsVolumeScanDetails -> ShowS
Prelude.Show, forall x. Rep EbsVolumeScanDetails x -> EbsVolumeScanDetails
forall x. EbsVolumeScanDetails -> Rep EbsVolumeScanDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EbsVolumeScanDetails x -> EbsVolumeScanDetails
$cfrom :: forall x. EbsVolumeScanDetails -> Rep EbsVolumeScanDetails x
Prelude.Generic)

-- |
-- Create a value of 'EbsVolumeScanDetails' 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:
--
-- 'scanCompletedAt', 'ebsVolumeScanDetails_scanCompletedAt' - Returns the completion date and time of the malware scan.
--
-- 'scanDetections', 'ebsVolumeScanDetails_scanDetections' - Contains a complete view providing malware scan result details.
--
-- 'scanId', 'ebsVolumeScanDetails_scanId' - Unique Id of the malware scan that generated the finding.
--
-- 'scanStartedAt', 'ebsVolumeScanDetails_scanStartedAt' - Returns the start date and time of the malware scan.
--
-- 'sources', 'ebsVolumeScanDetails_sources' - Contains list of threat intelligence sources used to detect threats.
--
-- 'triggerFindingId', 'ebsVolumeScanDetails_triggerFindingId' - GuardDuty finding ID that triggered a malware scan.
newEbsVolumeScanDetails ::
  EbsVolumeScanDetails
newEbsVolumeScanDetails :: EbsVolumeScanDetails
newEbsVolumeScanDetails =
  EbsVolumeScanDetails'
    { $sel:scanCompletedAt:EbsVolumeScanDetails' :: Maybe POSIX
scanCompletedAt =
        forall a. Maybe a
Prelude.Nothing,
      $sel:scanDetections:EbsVolumeScanDetails' :: Maybe ScanDetections
scanDetections = forall a. Maybe a
Prelude.Nothing,
      $sel:scanId:EbsVolumeScanDetails' :: Maybe Text
scanId = forall a. Maybe a
Prelude.Nothing,
      $sel:scanStartedAt:EbsVolumeScanDetails' :: Maybe POSIX
scanStartedAt = forall a. Maybe a
Prelude.Nothing,
      $sel:sources:EbsVolumeScanDetails' :: Maybe [Text]
sources = forall a. Maybe a
Prelude.Nothing,
      $sel:triggerFindingId:EbsVolumeScanDetails' :: Maybe Text
triggerFindingId = forall a. Maybe a
Prelude.Nothing
    }

-- | Returns the completion date and time of the malware scan.
ebsVolumeScanDetails_scanCompletedAt :: Lens.Lens' EbsVolumeScanDetails (Prelude.Maybe Prelude.UTCTime)
ebsVolumeScanDetails_scanCompletedAt :: Lens' EbsVolumeScanDetails (Maybe UTCTime)
ebsVolumeScanDetails_scanCompletedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsVolumeScanDetails' {Maybe POSIX
scanCompletedAt :: Maybe POSIX
$sel:scanCompletedAt:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe POSIX
scanCompletedAt} -> Maybe POSIX
scanCompletedAt) (\s :: EbsVolumeScanDetails
s@EbsVolumeScanDetails' {} Maybe POSIX
a -> EbsVolumeScanDetails
s {$sel:scanCompletedAt:EbsVolumeScanDetails' :: Maybe POSIX
scanCompletedAt = Maybe POSIX
a} :: EbsVolumeScanDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Contains a complete view providing malware scan result details.
ebsVolumeScanDetails_scanDetections :: Lens.Lens' EbsVolumeScanDetails (Prelude.Maybe ScanDetections)
ebsVolumeScanDetails_scanDetections :: Lens' EbsVolumeScanDetails (Maybe ScanDetections)
ebsVolumeScanDetails_scanDetections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsVolumeScanDetails' {Maybe ScanDetections
scanDetections :: Maybe ScanDetections
$sel:scanDetections:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe ScanDetections
scanDetections} -> Maybe ScanDetections
scanDetections) (\s :: EbsVolumeScanDetails
s@EbsVolumeScanDetails' {} Maybe ScanDetections
a -> EbsVolumeScanDetails
s {$sel:scanDetections:EbsVolumeScanDetails' :: Maybe ScanDetections
scanDetections = Maybe ScanDetections
a} :: EbsVolumeScanDetails)

-- | Unique Id of the malware scan that generated the finding.
ebsVolumeScanDetails_scanId :: Lens.Lens' EbsVolumeScanDetails (Prelude.Maybe Prelude.Text)
ebsVolumeScanDetails_scanId :: Lens' EbsVolumeScanDetails (Maybe Text)
ebsVolumeScanDetails_scanId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsVolumeScanDetails' {Maybe Text
scanId :: Maybe Text
$sel:scanId:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe Text
scanId} -> Maybe Text
scanId) (\s :: EbsVolumeScanDetails
s@EbsVolumeScanDetails' {} Maybe Text
a -> EbsVolumeScanDetails
s {$sel:scanId:EbsVolumeScanDetails' :: Maybe Text
scanId = Maybe Text
a} :: EbsVolumeScanDetails)

-- | Returns the start date and time of the malware scan.
ebsVolumeScanDetails_scanStartedAt :: Lens.Lens' EbsVolumeScanDetails (Prelude.Maybe Prelude.UTCTime)
ebsVolumeScanDetails_scanStartedAt :: Lens' EbsVolumeScanDetails (Maybe UTCTime)
ebsVolumeScanDetails_scanStartedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsVolumeScanDetails' {Maybe POSIX
scanStartedAt :: Maybe POSIX
$sel:scanStartedAt:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe POSIX
scanStartedAt} -> Maybe POSIX
scanStartedAt) (\s :: EbsVolumeScanDetails
s@EbsVolumeScanDetails' {} Maybe POSIX
a -> EbsVolumeScanDetails
s {$sel:scanStartedAt:EbsVolumeScanDetails' :: Maybe POSIX
scanStartedAt = Maybe POSIX
a} :: EbsVolumeScanDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Contains list of threat intelligence sources used to detect threats.
ebsVolumeScanDetails_sources :: Lens.Lens' EbsVolumeScanDetails (Prelude.Maybe [Prelude.Text])
ebsVolumeScanDetails_sources :: Lens' EbsVolumeScanDetails (Maybe [Text])
ebsVolumeScanDetails_sources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsVolumeScanDetails' {Maybe [Text]
sources :: Maybe [Text]
$sel:sources:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe [Text]
sources} -> Maybe [Text]
sources) (\s :: EbsVolumeScanDetails
s@EbsVolumeScanDetails' {} Maybe [Text]
a -> EbsVolumeScanDetails
s {$sel:sources:EbsVolumeScanDetails' :: Maybe [Text]
sources = Maybe [Text]
a} :: EbsVolumeScanDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | GuardDuty finding ID that triggered a malware scan.
ebsVolumeScanDetails_triggerFindingId :: Lens.Lens' EbsVolumeScanDetails (Prelude.Maybe Prelude.Text)
ebsVolumeScanDetails_triggerFindingId :: Lens' EbsVolumeScanDetails (Maybe Text)
ebsVolumeScanDetails_triggerFindingId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsVolumeScanDetails' {Maybe Text
triggerFindingId :: Maybe Text
$sel:triggerFindingId:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe Text
triggerFindingId} -> Maybe Text
triggerFindingId) (\s :: EbsVolumeScanDetails
s@EbsVolumeScanDetails' {} Maybe Text
a -> EbsVolumeScanDetails
s {$sel:triggerFindingId:EbsVolumeScanDetails' :: Maybe Text
triggerFindingId = Maybe Text
a} :: EbsVolumeScanDetails)

instance Data.FromJSON EbsVolumeScanDetails where
  parseJSON :: Value -> Parser EbsVolumeScanDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EbsVolumeScanDetails"
      ( \Object
x ->
          Maybe POSIX
-> Maybe ScanDetections
-> Maybe Text
-> Maybe POSIX
-> Maybe [Text]
-> Maybe Text
-> EbsVolumeScanDetails
EbsVolumeScanDetails'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"scanCompletedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"scanDetections")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"scanId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"scanStartedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sources" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"triggerFindingId")
      )

instance Prelude.Hashable EbsVolumeScanDetails where
  hashWithSalt :: Int -> EbsVolumeScanDetails -> Int
hashWithSalt Int
_salt EbsVolumeScanDetails' {Maybe [Text]
Maybe Text
Maybe POSIX
Maybe ScanDetections
triggerFindingId :: Maybe Text
sources :: Maybe [Text]
scanStartedAt :: Maybe POSIX
scanId :: Maybe Text
scanDetections :: Maybe ScanDetections
scanCompletedAt :: Maybe POSIX
$sel:triggerFindingId:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe Text
$sel:sources:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe [Text]
$sel:scanStartedAt:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe POSIX
$sel:scanId:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe Text
$sel:scanDetections:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe ScanDetections
$sel:scanCompletedAt:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
scanCompletedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScanDetections
scanDetections
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scanId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
scanStartedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
sources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
triggerFindingId

instance Prelude.NFData EbsVolumeScanDetails where
  rnf :: EbsVolumeScanDetails -> ()
rnf EbsVolumeScanDetails' {Maybe [Text]
Maybe Text
Maybe POSIX
Maybe ScanDetections
triggerFindingId :: Maybe Text
sources :: Maybe [Text]
scanStartedAt :: Maybe POSIX
scanId :: Maybe Text
scanDetections :: Maybe ScanDetections
scanCompletedAt :: Maybe POSIX
$sel:triggerFindingId:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe Text
$sel:sources:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe [Text]
$sel:scanStartedAt:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe POSIX
$sel:scanId:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe Text
$sel:scanDetections:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe ScanDetections
$sel:scanCompletedAt:EbsVolumeScanDetails' :: EbsVolumeScanDetails -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
scanCompletedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ScanDetections
scanDetections
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scanId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
scanStartedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
sources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
triggerFindingId