{-# 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.ScanFilePath
-- 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.ScanFilePath 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

-- | Contains details of infected file including name, file path and hash.
--
-- /See:/ 'newScanFilePath' smart constructor.
data ScanFilePath = ScanFilePath'
  { -- | File name of the infected file.
    ScanFilePath -> Maybe Text
fileName :: Prelude.Maybe Prelude.Text,
    -- | The file path of the infected file.
    ScanFilePath -> Maybe Text
filePath :: Prelude.Maybe Prelude.Text,
    -- | The hash value of the infected file.
    ScanFilePath -> Maybe Text
hash :: Prelude.Maybe Prelude.Text,
    -- | EBS volume Arn details of the infected file.
    ScanFilePath -> Maybe Text
volumeArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ScanFilePath -> ScanFilePath -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScanFilePath -> ScanFilePath -> Bool
$c/= :: ScanFilePath -> ScanFilePath -> Bool
== :: ScanFilePath -> ScanFilePath -> Bool
$c== :: ScanFilePath -> ScanFilePath -> Bool
Prelude.Eq, ReadPrec [ScanFilePath]
ReadPrec ScanFilePath
Int -> ReadS ScanFilePath
ReadS [ScanFilePath]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScanFilePath]
$creadListPrec :: ReadPrec [ScanFilePath]
readPrec :: ReadPrec ScanFilePath
$creadPrec :: ReadPrec ScanFilePath
readList :: ReadS [ScanFilePath]
$creadList :: ReadS [ScanFilePath]
readsPrec :: Int -> ReadS ScanFilePath
$creadsPrec :: Int -> ReadS ScanFilePath
Prelude.Read, Int -> ScanFilePath -> ShowS
[ScanFilePath] -> ShowS
ScanFilePath -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScanFilePath] -> ShowS
$cshowList :: [ScanFilePath] -> ShowS
show :: ScanFilePath -> String
$cshow :: ScanFilePath -> String
showsPrec :: Int -> ScanFilePath -> ShowS
$cshowsPrec :: Int -> ScanFilePath -> ShowS
Prelude.Show, forall x. Rep ScanFilePath x -> ScanFilePath
forall x. ScanFilePath -> Rep ScanFilePath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScanFilePath x -> ScanFilePath
$cfrom :: forall x. ScanFilePath -> Rep ScanFilePath x
Prelude.Generic)

-- |
-- Create a value of 'ScanFilePath' 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:
--
-- 'fileName', 'scanFilePath_fileName' - File name of the infected file.
--
-- 'filePath', 'scanFilePath_filePath' - The file path of the infected file.
--
-- 'hash', 'scanFilePath_hash' - The hash value of the infected file.
--
-- 'volumeArn', 'scanFilePath_volumeArn' - EBS volume Arn details of the infected file.
newScanFilePath ::
  ScanFilePath
newScanFilePath :: ScanFilePath
newScanFilePath =
  ScanFilePath'
    { $sel:fileName:ScanFilePath' :: Maybe Text
fileName = forall a. Maybe a
Prelude.Nothing,
      $sel:filePath:ScanFilePath' :: Maybe Text
filePath = forall a. Maybe a
Prelude.Nothing,
      $sel:hash:ScanFilePath' :: Maybe Text
hash = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeArn:ScanFilePath' :: Maybe Text
volumeArn = forall a. Maybe a
Prelude.Nothing
    }

-- | File name of the infected file.
scanFilePath_fileName :: Lens.Lens' ScanFilePath (Prelude.Maybe Prelude.Text)
scanFilePath_fileName :: Lens' ScanFilePath (Maybe Text)
scanFilePath_fileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScanFilePath' {Maybe Text
fileName :: Maybe Text
$sel:fileName:ScanFilePath' :: ScanFilePath -> Maybe Text
fileName} -> Maybe Text
fileName) (\s :: ScanFilePath
s@ScanFilePath' {} Maybe Text
a -> ScanFilePath
s {$sel:fileName:ScanFilePath' :: Maybe Text
fileName = Maybe Text
a} :: ScanFilePath)

-- | The file path of the infected file.
scanFilePath_filePath :: Lens.Lens' ScanFilePath (Prelude.Maybe Prelude.Text)
scanFilePath_filePath :: Lens' ScanFilePath (Maybe Text)
scanFilePath_filePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScanFilePath' {Maybe Text
filePath :: Maybe Text
$sel:filePath:ScanFilePath' :: ScanFilePath -> Maybe Text
filePath} -> Maybe Text
filePath) (\s :: ScanFilePath
s@ScanFilePath' {} Maybe Text
a -> ScanFilePath
s {$sel:filePath:ScanFilePath' :: Maybe Text
filePath = Maybe Text
a} :: ScanFilePath)

-- | The hash value of the infected file.
scanFilePath_hash :: Lens.Lens' ScanFilePath (Prelude.Maybe Prelude.Text)
scanFilePath_hash :: Lens' ScanFilePath (Maybe Text)
scanFilePath_hash = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScanFilePath' {Maybe Text
hash :: Maybe Text
$sel:hash:ScanFilePath' :: ScanFilePath -> Maybe Text
hash} -> Maybe Text
hash) (\s :: ScanFilePath
s@ScanFilePath' {} Maybe Text
a -> ScanFilePath
s {$sel:hash:ScanFilePath' :: Maybe Text
hash = Maybe Text
a} :: ScanFilePath)

-- | EBS volume Arn details of the infected file.
scanFilePath_volumeArn :: Lens.Lens' ScanFilePath (Prelude.Maybe Prelude.Text)
scanFilePath_volumeArn :: Lens' ScanFilePath (Maybe Text)
scanFilePath_volumeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScanFilePath' {Maybe Text
volumeArn :: Maybe Text
$sel:volumeArn:ScanFilePath' :: ScanFilePath -> Maybe Text
volumeArn} -> Maybe Text
volumeArn) (\s :: ScanFilePath
s@ScanFilePath' {} Maybe Text
a -> ScanFilePath
s {$sel:volumeArn:ScanFilePath' :: Maybe Text
volumeArn = Maybe Text
a} :: ScanFilePath)

instance Data.FromJSON ScanFilePath where
  parseJSON :: Value -> Parser ScanFilePath
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ScanFilePath"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ScanFilePath
ScanFilePath'
            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
"fileName")
            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
"filePath")
            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
"hash")
            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
"volumeArn")
      )

instance Prelude.Hashable ScanFilePath where
  hashWithSalt :: Int -> ScanFilePath -> Int
hashWithSalt Int
_salt ScanFilePath' {Maybe Text
volumeArn :: Maybe Text
hash :: Maybe Text
filePath :: Maybe Text
fileName :: Maybe Text
$sel:volumeArn:ScanFilePath' :: ScanFilePath -> Maybe Text
$sel:hash:ScanFilePath' :: ScanFilePath -> Maybe Text
$sel:filePath:ScanFilePath' :: ScanFilePath -> Maybe Text
$sel:fileName:ScanFilePath' :: ScanFilePath -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fileName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
filePath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hash
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeArn

instance Prelude.NFData ScanFilePath where
  rnf :: ScanFilePath -> ()
rnf ScanFilePath' {Maybe Text
volumeArn :: Maybe Text
hash :: Maybe Text
filePath :: Maybe Text
fileName :: Maybe Text
$sel:volumeArn:ScanFilePath' :: ScanFilePath -> Maybe Text
$sel:hash:ScanFilePath' :: ScanFilePath -> Maybe Text
$sel:filePath:ScanFilePath' :: ScanFilePath -> Maybe Text
$sel:fileName:ScanFilePath' :: ScanFilePath -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
filePath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hash
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeArn