{-# 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.AuditManager.Types.ManualEvidence
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AuditManager.Types.ManualEvidence where

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

-- | Evidence that is uploaded to Audit Manager manually.
--
-- /See:/ 'newManualEvidence' smart constructor.
data ManualEvidence = ManualEvidence'
  { -- | The Amazon S3 URL that points to a manual evidence object.
    ManualEvidence -> Maybe Text
s3ResourcePath :: Prelude.Maybe Prelude.Text
  }
  deriving (ManualEvidence -> ManualEvidence -> Bool
(ManualEvidence -> ManualEvidence -> Bool)
-> (ManualEvidence -> ManualEvidence -> Bool) -> Eq ManualEvidence
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManualEvidence -> ManualEvidence -> Bool
$c/= :: ManualEvidence -> ManualEvidence -> Bool
== :: ManualEvidence -> ManualEvidence -> Bool
$c== :: ManualEvidence -> ManualEvidence -> Bool
Prelude.Eq, ReadPrec [ManualEvidence]
ReadPrec ManualEvidence
Int -> ReadS ManualEvidence
ReadS [ManualEvidence]
(Int -> ReadS ManualEvidence)
-> ReadS [ManualEvidence]
-> ReadPrec ManualEvidence
-> ReadPrec [ManualEvidence]
-> Read ManualEvidence
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManualEvidence]
$creadListPrec :: ReadPrec [ManualEvidence]
readPrec :: ReadPrec ManualEvidence
$creadPrec :: ReadPrec ManualEvidence
readList :: ReadS [ManualEvidence]
$creadList :: ReadS [ManualEvidence]
readsPrec :: Int -> ReadS ManualEvidence
$creadsPrec :: Int -> ReadS ManualEvidence
Prelude.Read, Int -> ManualEvidence -> ShowS
[ManualEvidence] -> ShowS
ManualEvidence -> String
(Int -> ManualEvidence -> ShowS)
-> (ManualEvidence -> String)
-> ([ManualEvidence] -> ShowS)
-> Show ManualEvidence
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManualEvidence] -> ShowS
$cshowList :: [ManualEvidence] -> ShowS
show :: ManualEvidence -> String
$cshow :: ManualEvidence -> String
showsPrec :: Int -> ManualEvidence -> ShowS
$cshowsPrec :: Int -> ManualEvidence -> ShowS
Prelude.Show, (forall x. ManualEvidence -> Rep ManualEvidence x)
-> (forall x. Rep ManualEvidence x -> ManualEvidence)
-> Generic ManualEvidence
forall x. Rep ManualEvidence x -> ManualEvidence
forall x. ManualEvidence -> Rep ManualEvidence x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManualEvidence x -> ManualEvidence
$cfrom :: forall x. ManualEvidence -> Rep ManualEvidence x
Prelude.Generic)

-- |
-- Create a value of 'ManualEvidence' 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:
--
-- 's3ResourcePath', 'manualEvidence_s3ResourcePath' - The Amazon S3 URL that points to a manual evidence object.
newManualEvidence ::
  ManualEvidence
newManualEvidence :: ManualEvidence
newManualEvidence =
  ManualEvidence' :: Maybe Text -> ManualEvidence
ManualEvidence' {$sel:s3ResourcePath:ManualEvidence' :: Maybe Text
s3ResourcePath = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The Amazon S3 URL that points to a manual evidence object.
manualEvidence_s3ResourcePath :: Lens.Lens' ManualEvidence (Prelude.Maybe Prelude.Text)
manualEvidence_s3ResourcePath :: (Maybe Text -> f (Maybe Text))
-> ManualEvidence -> f ManualEvidence
manualEvidence_s3ResourcePath = (ManualEvidence -> Maybe Text)
-> (ManualEvidence -> Maybe Text -> ManualEvidence)
-> Lens ManualEvidence ManualEvidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManualEvidence' {Maybe Text
s3ResourcePath :: Maybe Text
$sel:s3ResourcePath:ManualEvidence' :: ManualEvidence -> Maybe Text
s3ResourcePath} -> Maybe Text
s3ResourcePath) (\s :: ManualEvidence
s@ManualEvidence' {} Maybe Text
a -> ManualEvidence
s {$sel:s3ResourcePath:ManualEvidence' :: Maybe Text
s3ResourcePath = Maybe Text
a} :: ManualEvidence)

instance Core.FromJSON ManualEvidence where
  parseJSON :: Value -> Parser ManualEvidence
parseJSON =
    String
-> (Object -> Parser ManualEvidence)
-> Value
-> Parser ManualEvidence
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ManualEvidence"
      ( \Object
x ->
          Maybe Text -> ManualEvidence
ManualEvidence'
            (Maybe Text -> ManualEvidence)
-> Parser (Maybe Text) -> Parser ManualEvidence
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3ResourcePath")
      )

instance Prelude.Hashable ManualEvidence

instance Prelude.NFData ManualEvidence

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