{-# 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.Asset 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
import Amazonka.Rekognition.Types.GroundTruthManifest
data Asset = Asset'
{ Asset -> Maybe GroundTruthManifest
groundTruthManifest :: Prelude.Maybe GroundTruthManifest
}
deriving (Asset -> Asset -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Asset -> Asset -> Bool
$c/= :: Asset -> Asset -> Bool
== :: Asset -> Asset -> Bool
$c== :: Asset -> Asset -> Bool
Prelude.Eq, ReadPrec [Asset]
ReadPrec Asset
Int -> ReadS Asset
ReadS [Asset]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Asset]
$creadListPrec :: ReadPrec [Asset]
readPrec :: ReadPrec Asset
$creadPrec :: ReadPrec Asset
readList :: ReadS [Asset]
$creadList :: ReadS [Asset]
readsPrec :: Int -> ReadS Asset
$creadsPrec :: Int -> ReadS Asset
Prelude.Read, Int -> Asset -> ShowS
[Asset] -> ShowS
Asset -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Asset] -> ShowS
$cshowList :: [Asset] -> ShowS
show :: Asset -> String
$cshow :: Asset -> String
showsPrec :: Int -> Asset -> ShowS
$cshowsPrec :: Int -> Asset -> ShowS
Prelude.Show, forall x. Rep Asset x -> Asset
forall x. Asset -> Rep Asset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Asset x -> Asset
$cfrom :: forall x. Asset -> Rep Asset x
Prelude.Generic)
newAsset ::
Asset
newAsset :: Asset
newAsset =
Asset' {$sel:groundTruthManifest:Asset' :: Maybe GroundTruthManifest
groundTruthManifest = forall a. Maybe a
Prelude.Nothing}
asset_groundTruthManifest :: Lens.Lens' Asset (Prelude.Maybe GroundTruthManifest)
asset_groundTruthManifest :: Lens' Asset (Maybe GroundTruthManifest)
asset_groundTruthManifest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Asset' {Maybe GroundTruthManifest
groundTruthManifest :: Maybe GroundTruthManifest
$sel:groundTruthManifest:Asset' :: Asset -> Maybe GroundTruthManifest
groundTruthManifest} -> Maybe GroundTruthManifest
groundTruthManifest) (\s :: Asset
s@Asset' {} Maybe GroundTruthManifest
a -> Asset
s {$sel:groundTruthManifest:Asset' :: Maybe GroundTruthManifest
groundTruthManifest = Maybe GroundTruthManifest
a} :: Asset)
instance Data.FromJSON Asset where
parseJSON :: Value -> Parser Asset
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Asset"
( \Object
x ->
Maybe GroundTruthManifest -> Asset
Asset'
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
"GroundTruthManifest")
)
instance Prelude.Hashable Asset where
hashWithSalt :: Int -> Asset -> Int
hashWithSalt Int
_salt Asset' {Maybe GroundTruthManifest
groundTruthManifest :: Maybe GroundTruthManifest
$sel:groundTruthManifest:Asset' :: Asset -> Maybe GroundTruthManifest
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GroundTruthManifest
groundTruthManifest
instance Prelude.NFData Asset where
rnf :: Asset -> ()
rnf Asset' {Maybe GroundTruthManifest
groundTruthManifest :: Maybe GroundTruthManifest
$sel:groundTruthManifest:Asset' :: Asset -> Maybe GroundTruthManifest
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe GroundTruthManifest
groundTruthManifest
instance Data.ToJSON Asset where
toJSON :: Asset -> Value
toJSON Asset' {Maybe GroundTruthManifest
groundTruthManifest :: Maybe GroundTruthManifest
$sel:groundTruthManifest:Asset' :: Asset -> Maybe GroundTruthManifest
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"GroundTruthManifest" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GroundTruthManifest
groundTruthManifest
]
)