{-# 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.LookoutVision.Types.DatasetMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutVision.Types.DatasetStatus
import qualified Amazonka.Prelude as Prelude
data DatasetMetadata = DatasetMetadata'
{
DatasetMetadata -> Maybe DatasetStatus
status :: Prelude.Maybe DatasetStatus,
DatasetMetadata -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
DatasetMetadata -> Maybe POSIX
creationTimestamp :: Prelude.Maybe Core.POSIX,
DatasetMetadata -> Maybe Text
datasetType :: Prelude.Maybe Prelude.Text
}
deriving (DatasetMetadata -> DatasetMetadata -> Bool
(DatasetMetadata -> DatasetMetadata -> Bool)
-> (DatasetMetadata -> DatasetMetadata -> Bool)
-> Eq DatasetMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetMetadata -> DatasetMetadata -> Bool
$c/= :: DatasetMetadata -> DatasetMetadata -> Bool
== :: DatasetMetadata -> DatasetMetadata -> Bool
$c== :: DatasetMetadata -> DatasetMetadata -> Bool
Prelude.Eq, ReadPrec [DatasetMetadata]
ReadPrec DatasetMetadata
Int -> ReadS DatasetMetadata
ReadS [DatasetMetadata]
(Int -> ReadS DatasetMetadata)
-> ReadS [DatasetMetadata]
-> ReadPrec DatasetMetadata
-> ReadPrec [DatasetMetadata]
-> Read DatasetMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetMetadata]
$creadListPrec :: ReadPrec [DatasetMetadata]
readPrec :: ReadPrec DatasetMetadata
$creadPrec :: ReadPrec DatasetMetadata
readList :: ReadS [DatasetMetadata]
$creadList :: ReadS [DatasetMetadata]
readsPrec :: Int -> ReadS DatasetMetadata
$creadsPrec :: Int -> ReadS DatasetMetadata
Prelude.Read, Int -> DatasetMetadata -> ShowS
[DatasetMetadata] -> ShowS
DatasetMetadata -> String
(Int -> DatasetMetadata -> ShowS)
-> (DatasetMetadata -> String)
-> ([DatasetMetadata] -> ShowS)
-> Show DatasetMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetMetadata] -> ShowS
$cshowList :: [DatasetMetadata] -> ShowS
show :: DatasetMetadata -> String
$cshow :: DatasetMetadata -> String
showsPrec :: Int -> DatasetMetadata -> ShowS
$cshowsPrec :: Int -> DatasetMetadata -> ShowS
Prelude.Show, (forall x. DatasetMetadata -> Rep DatasetMetadata x)
-> (forall x. Rep DatasetMetadata x -> DatasetMetadata)
-> Generic DatasetMetadata
forall x. Rep DatasetMetadata x -> DatasetMetadata
forall x. DatasetMetadata -> Rep DatasetMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetMetadata x -> DatasetMetadata
$cfrom :: forall x. DatasetMetadata -> Rep DatasetMetadata x
Prelude.Generic)
newDatasetMetadata ::
DatasetMetadata
newDatasetMetadata :: DatasetMetadata
newDatasetMetadata =
DatasetMetadata' :: Maybe DatasetStatus
-> Maybe Text -> Maybe POSIX -> Maybe Text -> DatasetMetadata
DatasetMetadata'
{ $sel:status:DatasetMetadata' :: Maybe DatasetStatus
status = Maybe DatasetStatus
forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:DatasetMetadata' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimestamp:DatasetMetadata' :: Maybe POSIX
creationTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:datasetType:DatasetMetadata' :: Maybe Text
datasetType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
datasetMetadata_status :: Lens.Lens' DatasetMetadata (Prelude.Maybe DatasetStatus)
datasetMetadata_status :: (Maybe DatasetStatus -> f (Maybe DatasetStatus))
-> DatasetMetadata -> f DatasetMetadata
datasetMetadata_status = (DatasetMetadata -> Maybe DatasetStatus)
-> (DatasetMetadata -> Maybe DatasetStatus -> DatasetMetadata)
-> Lens
DatasetMetadata
DatasetMetadata
(Maybe DatasetStatus)
(Maybe DatasetStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetMetadata' {Maybe DatasetStatus
status :: Maybe DatasetStatus
$sel:status:DatasetMetadata' :: DatasetMetadata -> Maybe DatasetStatus
status} -> Maybe DatasetStatus
status) (\s :: DatasetMetadata
s@DatasetMetadata' {} Maybe DatasetStatus
a -> DatasetMetadata
s {$sel:status:DatasetMetadata' :: Maybe DatasetStatus
status = Maybe DatasetStatus
a} :: DatasetMetadata)
datasetMetadata_statusMessage :: Lens.Lens' DatasetMetadata (Prelude.Maybe Prelude.Text)
datasetMetadata_statusMessage :: (Maybe Text -> f (Maybe Text))
-> DatasetMetadata -> f DatasetMetadata
datasetMetadata_statusMessage = (DatasetMetadata -> Maybe Text)
-> (DatasetMetadata -> Maybe Text -> DatasetMetadata)
-> Lens DatasetMetadata DatasetMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetMetadata' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:DatasetMetadata' :: DatasetMetadata -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: DatasetMetadata
s@DatasetMetadata' {} Maybe Text
a -> DatasetMetadata
s {$sel:statusMessage:DatasetMetadata' :: Maybe Text
statusMessage = Maybe Text
a} :: DatasetMetadata)
datasetMetadata_creationTimestamp :: Lens.Lens' DatasetMetadata (Prelude.Maybe Prelude.UTCTime)
datasetMetadata_creationTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetMetadata -> f DatasetMetadata
datasetMetadata_creationTimestamp = (DatasetMetadata -> Maybe POSIX)
-> (DatasetMetadata -> Maybe POSIX -> DatasetMetadata)
-> Lens DatasetMetadata DatasetMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetMetadata' {Maybe POSIX
creationTimestamp :: Maybe POSIX
$sel:creationTimestamp:DatasetMetadata' :: DatasetMetadata -> Maybe POSIX
creationTimestamp} -> Maybe POSIX
creationTimestamp) (\s :: DatasetMetadata
s@DatasetMetadata' {} Maybe POSIX
a -> DatasetMetadata
s {$sel:creationTimestamp:DatasetMetadata' :: Maybe POSIX
creationTimestamp = Maybe POSIX
a} :: DatasetMetadata) ((Maybe POSIX -> f (Maybe POSIX))
-> DatasetMetadata -> f DatasetMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetMetadata
-> f DatasetMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
datasetMetadata_datasetType :: Lens.Lens' DatasetMetadata (Prelude.Maybe Prelude.Text)
datasetMetadata_datasetType :: (Maybe Text -> f (Maybe Text))
-> DatasetMetadata -> f DatasetMetadata
datasetMetadata_datasetType = (DatasetMetadata -> Maybe Text)
-> (DatasetMetadata -> Maybe Text -> DatasetMetadata)
-> Lens DatasetMetadata DatasetMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetMetadata' {Maybe Text
datasetType :: Maybe Text
$sel:datasetType:DatasetMetadata' :: DatasetMetadata -> Maybe Text
datasetType} -> Maybe Text
datasetType) (\s :: DatasetMetadata
s@DatasetMetadata' {} Maybe Text
a -> DatasetMetadata
s {$sel:datasetType:DatasetMetadata' :: Maybe Text
datasetType = Maybe Text
a} :: DatasetMetadata)
instance Core.FromJSON DatasetMetadata where
parseJSON :: Value -> Parser DatasetMetadata
parseJSON =
String
-> (Object -> Parser DatasetMetadata)
-> Value
-> Parser DatasetMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DatasetMetadata"
( \Object
x ->
Maybe DatasetStatus
-> Maybe Text -> Maybe POSIX -> Maybe Text -> DatasetMetadata
DatasetMetadata'
(Maybe DatasetStatus
-> Maybe Text -> Maybe POSIX -> Maybe Text -> DatasetMetadata)
-> Parser (Maybe DatasetStatus)
-> Parser
(Maybe Text -> Maybe POSIX -> Maybe Text -> DatasetMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DatasetStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> DatasetMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> DatasetMetadata)
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
"StatusMessage")
Parser (Maybe POSIX -> Maybe Text -> DatasetMetadata)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> DatasetMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTimestamp")
Parser (Maybe Text -> DatasetMetadata)
-> Parser (Maybe Text) -> Parser DatasetMetadata
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
"DatasetType")
)
instance Prelude.Hashable DatasetMetadata
instance Prelude.NFData DatasetMetadata