{-# 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.FraudDetector.Types.FileValidationMessage
-- 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.FraudDetector.Types.FileValidationMessage where

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

-- | The message details.
--
-- /See:/ 'newFileValidationMessage' smart constructor.
data FileValidationMessage = FileValidationMessage'
  { -- | The message content.
    FileValidationMessage -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
    -- | The message title.
    FileValidationMessage -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | The message type.
    FileValidationMessage -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (FileValidationMessage -> FileValidationMessage -> Bool
(FileValidationMessage -> FileValidationMessage -> Bool)
-> (FileValidationMessage -> FileValidationMessage -> Bool)
-> Eq FileValidationMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileValidationMessage -> FileValidationMessage -> Bool
$c/= :: FileValidationMessage -> FileValidationMessage -> Bool
== :: FileValidationMessage -> FileValidationMessage -> Bool
$c== :: FileValidationMessage -> FileValidationMessage -> Bool
Prelude.Eq, ReadPrec [FileValidationMessage]
ReadPrec FileValidationMessage
Int -> ReadS FileValidationMessage
ReadS [FileValidationMessage]
(Int -> ReadS FileValidationMessage)
-> ReadS [FileValidationMessage]
-> ReadPrec FileValidationMessage
-> ReadPrec [FileValidationMessage]
-> Read FileValidationMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileValidationMessage]
$creadListPrec :: ReadPrec [FileValidationMessage]
readPrec :: ReadPrec FileValidationMessage
$creadPrec :: ReadPrec FileValidationMessage
readList :: ReadS [FileValidationMessage]
$creadList :: ReadS [FileValidationMessage]
readsPrec :: Int -> ReadS FileValidationMessage
$creadsPrec :: Int -> ReadS FileValidationMessage
Prelude.Read, Int -> FileValidationMessage -> ShowS
[FileValidationMessage] -> ShowS
FileValidationMessage -> String
(Int -> FileValidationMessage -> ShowS)
-> (FileValidationMessage -> String)
-> ([FileValidationMessage] -> ShowS)
-> Show FileValidationMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileValidationMessage] -> ShowS
$cshowList :: [FileValidationMessage] -> ShowS
show :: FileValidationMessage -> String
$cshow :: FileValidationMessage -> String
showsPrec :: Int -> FileValidationMessage -> ShowS
$cshowsPrec :: Int -> FileValidationMessage -> ShowS
Prelude.Show, (forall x. FileValidationMessage -> Rep FileValidationMessage x)
-> (forall x. Rep FileValidationMessage x -> FileValidationMessage)
-> Generic FileValidationMessage
forall x. Rep FileValidationMessage x -> FileValidationMessage
forall x. FileValidationMessage -> Rep FileValidationMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FileValidationMessage x -> FileValidationMessage
$cfrom :: forall x. FileValidationMessage -> Rep FileValidationMessage x
Prelude.Generic)

-- |
-- Create a value of 'FileValidationMessage' 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:
--
-- 'content', 'fileValidationMessage_content' - The message content.
--
-- 'title', 'fileValidationMessage_title' - The message title.
--
-- 'type'', 'fileValidationMessage_type' - The message type.
newFileValidationMessage ::
  FileValidationMessage
newFileValidationMessage :: FileValidationMessage
newFileValidationMessage =
  FileValidationMessage' :: Maybe Text -> Maybe Text -> Maybe Text -> FileValidationMessage
FileValidationMessage'
    { $sel:content:FileValidationMessage' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:title:FileValidationMessage' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':FileValidationMessage' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The message content.
fileValidationMessage_content :: Lens.Lens' FileValidationMessage (Prelude.Maybe Prelude.Text)
fileValidationMessage_content :: (Maybe Text -> f (Maybe Text))
-> FileValidationMessage -> f FileValidationMessage
fileValidationMessage_content = (FileValidationMessage -> Maybe Text)
-> (FileValidationMessage -> Maybe Text -> FileValidationMessage)
-> Lens
     FileValidationMessage
     FileValidationMessage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileValidationMessage' {Maybe Text
content :: Maybe Text
$sel:content:FileValidationMessage' :: FileValidationMessage -> Maybe Text
content} -> Maybe Text
content) (\s :: FileValidationMessage
s@FileValidationMessage' {} Maybe Text
a -> FileValidationMessage
s {$sel:content:FileValidationMessage' :: Maybe Text
content = Maybe Text
a} :: FileValidationMessage)

-- | The message title.
fileValidationMessage_title :: Lens.Lens' FileValidationMessage (Prelude.Maybe Prelude.Text)
fileValidationMessage_title :: (Maybe Text -> f (Maybe Text))
-> FileValidationMessage -> f FileValidationMessage
fileValidationMessage_title = (FileValidationMessage -> Maybe Text)
-> (FileValidationMessage -> Maybe Text -> FileValidationMessage)
-> Lens
     FileValidationMessage
     FileValidationMessage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileValidationMessage' {Maybe Text
title :: Maybe Text
$sel:title:FileValidationMessage' :: FileValidationMessage -> Maybe Text
title} -> Maybe Text
title) (\s :: FileValidationMessage
s@FileValidationMessage' {} Maybe Text
a -> FileValidationMessage
s {$sel:title:FileValidationMessage' :: Maybe Text
title = Maybe Text
a} :: FileValidationMessage)

-- | The message type.
fileValidationMessage_type :: Lens.Lens' FileValidationMessage (Prelude.Maybe Prelude.Text)
fileValidationMessage_type :: (Maybe Text -> f (Maybe Text))
-> FileValidationMessage -> f FileValidationMessage
fileValidationMessage_type = (FileValidationMessage -> Maybe Text)
-> (FileValidationMessage -> Maybe Text -> FileValidationMessage)
-> Lens
     FileValidationMessage
     FileValidationMessage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileValidationMessage' {Maybe Text
type' :: Maybe Text
$sel:type':FileValidationMessage' :: FileValidationMessage -> Maybe Text
type'} -> Maybe Text
type') (\s :: FileValidationMessage
s@FileValidationMessage' {} Maybe Text
a -> FileValidationMessage
s {$sel:type':FileValidationMessage' :: Maybe Text
type' = Maybe Text
a} :: FileValidationMessage)

instance Core.FromJSON FileValidationMessage where
  parseJSON :: Value -> Parser FileValidationMessage
parseJSON =
    String
-> (Object -> Parser FileValidationMessage)
-> Value
-> Parser FileValidationMessage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FileValidationMessage"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> FileValidationMessage
FileValidationMessage'
            (Maybe Text -> Maybe Text -> Maybe Text -> FileValidationMessage)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> FileValidationMessage)
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
"content")
            Parser (Maybe Text -> Maybe Text -> FileValidationMessage)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> FileValidationMessage)
forall (f :: * -> *) a b. Applicative f => 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
"title")
            Parser (Maybe Text -> FileValidationMessage)
-> Parser (Maybe Text) -> Parser FileValidationMessage
forall (f :: * -> *) a b. Applicative f => 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
"type")
      )

instance Prelude.Hashable FileValidationMessage

instance Prelude.NFData FileValidationMessage