{-# 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 #-}
module Amazonka.Rekognition.Types.ValidationData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.Asset
data ValidationData = ValidationData'
{
ValidationData -> Maybe [Asset]
assets :: Prelude.Maybe [Asset]
}
deriving (ValidationData -> ValidationData -> Bool
(ValidationData -> ValidationData -> Bool)
-> (ValidationData -> ValidationData -> Bool) -> Eq ValidationData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidationData -> ValidationData -> Bool
$c/= :: ValidationData -> ValidationData -> Bool
== :: ValidationData -> ValidationData -> Bool
$c== :: ValidationData -> ValidationData -> Bool
Prelude.Eq, ReadPrec [ValidationData]
ReadPrec ValidationData
Int -> ReadS ValidationData
ReadS [ValidationData]
(Int -> ReadS ValidationData)
-> ReadS [ValidationData]
-> ReadPrec ValidationData
-> ReadPrec [ValidationData]
-> Read ValidationData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ValidationData]
$creadListPrec :: ReadPrec [ValidationData]
readPrec :: ReadPrec ValidationData
$creadPrec :: ReadPrec ValidationData
readList :: ReadS [ValidationData]
$creadList :: ReadS [ValidationData]
readsPrec :: Int -> ReadS ValidationData
$creadsPrec :: Int -> ReadS ValidationData
Prelude.Read, Int -> ValidationData -> ShowS
[ValidationData] -> ShowS
ValidationData -> String
(Int -> ValidationData -> ShowS)
-> (ValidationData -> String)
-> ([ValidationData] -> ShowS)
-> Show ValidationData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ValidationData] -> ShowS
$cshowList :: [ValidationData] -> ShowS
show :: ValidationData -> String
$cshow :: ValidationData -> String
showsPrec :: Int -> ValidationData -> ShowS
$cshowsPrec :: Int -> ValidationData -> ShowS
Prelude.Show, (forall x. ValidationData -> Rep ValidationData x)
-> (forall x. Rep ValidationData x -> ValidationData)
-> Generic ValidationData
forall x. Rep ValidationData x -> ValidationData
forall x. ValidationData -> Rep ValidationData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ValidationData x -> ValidationData
$cfrom :: forall x. ValidationData -> Rep ValidationData x
Prelude.Generic)
newValidationData ::
ValidationData
newValidationData :: ValidationData
newValidationData =
ValidationData' :: Maybe [Asset] -> ValidationData
ValidationData' {$sel:assets:ValidationData' :: Maybe [Asset]
assets = Maybe [Asset]
forall a. Maybe a
Prelude.Nothing}
validationData_assets :: Lens.Lens' ValidationData (Prelude.Maybe [Asset])
validationData_assets :: (Maybe [Asset] -> f (Maybe [Asset]))
-> ValidationData -> f ValidationData
validationData_assets = (ValidationData -> Maybe [Asset])
-> (ValidationData -> Maybe [Asset] -> ValidationData)
-> Lens
ValidationData ValidationData (Maybe [Asset]) (Maybe [Asset])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidationData' {Maybe [Asset]
assets :: Maybe [Asset]
$sel:assets:ValidationData' :: ValidationData -> Maybe [Asset]
assets} -> Maybe [Asset]
assets) (\s :: ValidationData
s@ValidationData' {} Maybe [Asset]
a -> ValidationData
s {$sel:assets:ValidationData' :: Maybe [Asset]
assets = Maybe [Asset]
a} :: ValidationData) ((Maybe [Asset] -> f (Maybe [Asset]))
-> ValidationData -> f ValidationData)
-> ((Maybe [Asset] -> f (Maybe [Asset]))
-> Maybe [Asset] -> f (Maybe [Asset]))
-> (Maybe [Asset] -> f (Maybe [Asset]))
-> ValidationData
-> f ValidationData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Asset] [Asset] [Asset] [Asset]
-> Iso
(Maybe [Asset]) (Maybe [Asset]) (Maybe [Asset]) (Maybe [Asset])
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 AnIso [Asset] [Asset] [Asset] [Asset]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ValidationData where
parseJSON :: Value -> Parser ValidationData
parseJSON =
String
-> (Object -> Parser ValidationData)
-> Value
-> Parser ValidationData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ValidationData"
( \Object
x ->
Maybe [Asset] -> ValidationData
ValidationData'
(Maybe [Asset] -> ValidationData)
-> Parser (Maybe [Asset]) -> Parser ValidationData
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Asset]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Assets" Parser (Maybe (Maybe [Asset]))
-> Maybe [Asset] -> Parser (Maybe [Asset])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Asset]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ValidationData
instance Prelude.NFData ValidationData