{-# 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.DataExchange.Types.AssetEntry where
import qualified Amazonka.Core as Core
import Amazonka.DataExchange.Types.AssetDetails
import Amazonka.DataExchange.Types.AssetType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssetEntry = AssetEntry'
{
AssetEntry -> Maybe Text
sourceId :: Prelude.Maybe Prelude.Text,
AssetEntry -> AssetType
assetType :: AssetType,
AssetEntry -> POSIX
createdAt :: Core.POSIX,
AssetEntry -> Text
dataSetId :: Prelude.Text,
AssetEntry -> Text
id :: Prelude.Text,
AssetEntry -> Text
arn :: Prelude.Text,
AssetEntry -> AssetDetails
assetDetails :: AssetDetails,
AssetEntry -> POSIX
updatedAt :: Core.POSIX,
AssetEntry -> Text
revisionId :: Prelude.Text,
AssetEntry -> Text
name :: Prelude.Text
}
deriving (AssetEntry -> AssetEntry -> Bool
(AssetEntry -> AssetEntry -> Bool)
-> (AssetEntry -> AssetEntry -> Bool) -> Eq AssetEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetEntry -> AssetEntry -> Bool
$c/= :: AssetEntry -> AssetEntry -> Bool
== :: AssetEntry -> AssetEntry -> Bool
$c== :: AssetEntry -> AssetEntry -> Bool
Prelude.Eq, ReadPrec [AssetEntry]
ReadPrec AssetEntry
Int -> ReadS AssetEntry
ReadS [AssetEntry]
(Int -> ReadS AssetEntry)
-> ReadS [AssetEntry]
-> ReadPrec AssetEntry
-> ReadPrec [AssetEntry]
-> Read AssetEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetEntry]
$creadListPrec :: ReadPrec [AssetEntry]
readPrec :: ReadPrec AssetEntry
$creadPrec :: ReadPrec AssetEntry
readList :: ReadS [AssetEntry]
$creadList :: ReadS [AssetEntry]
readsPrec :: Int -> ReadS AssetEntry
$creadsPrec :: Int -> ReadS AssetEntry
Prelude.Read, Int -> AssetEntry -> ShowS
[AssetEntry] -> ShowS
AssetEntry -> String
(Int -> AssetEntry -> ShowS)
-> (AssetEntry -> String)
-> ([AssetEntry] -> ShowS)
-> Show AssetEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetEntry] -> ShowS
$cshowList :: [AssetEntry] -> ShowS
show :: AssetEntry -> String
$cshow :: AssetEntry -> String
showsPrec :: Int -> AssetEntry -> ShowS
$cshowsPrec :: Int -> AssetEntry -> ShowS
Prelude.Show, (forall x. AssetEntry -> Rep AssetEntry x)
-> (forall x. Rep AssetEntry x -> AssetEntry) -> Generic AssetEntry
forall x. Rep AssetEntry x -> AssetEntry
forall x. AssetEntry -> Rep AssetEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetEntry x -> AssetEntry
$cfrom :: forall x. AssetEntry -> Rep AssetEntry x
Prelude.Generic)
newAssetEntry ::
AssetType ->
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AssetDetails ->
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
AssetEntry
newAssetEntry :: AssetType
-> UTCTime
-> Text
-> Text
-> Text
-> AssetDetails
-> UTCTime
-> Text
-> Text
-> AssetEntry
newAssetEntry
AssetType
pAssetType_
UTCTime
pCreatedAt_
Text
pDataSetId_
Text
pId_
Text
pArn_
AssetDetails
pAssetDetails_
UTCTime
pUpdatedAt_
Text
pRevisionId_
Text
pName_ =
AssetEntry' :: Maybe Text
-> AssetType
-> POSIX
-> Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry
AssetEntry'
{ $sel:sourceId:AssetEntry' :: Maybe Text
sourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assetType:AssetEntry' :: AssetType
assetType = AssetType
pAssetType_,
$sel:createdAt:AssetEntry' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:dataSetId:AssetEntry' :: Text
dataSetId = Text
pDataSetId_,
$sel:id:AssetEntry' :: Text
id = Text
pId_,
$sel:arn:AssetEntry' :: Text
arn = Text
pArn_,
$sel:assetDetails:AssetEntry' :: AssetDetails
assetDetails = AssetDetails
pAssetDetails_,
$sel:updatedAt:AssetEntry' :: POSIX
updatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedAt_,
$sel:revisionId:AssetEntry' :: Text
revisionId = Text
pRevisionId_,
$sel:name:AssetEntry' :: Text
name = Text
pName_
}
assetEntry_sourceId :: Lens.Lens' AssetEntry (Prelude.Maybe Prelude.Text)
assetEntry_sourceId :: (Maybe Text -> f (Maybe Text)) -> AssetEntry -> f AssetEntry
assetEntry_sourceId = (AssetEntry -> Maybe Text)
-> (AssetEntry -> Maybe Text -> AssetEntry)
-> Lens AssetEntry AssetEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {Maybe Text
sourceId :: Maybe Text
$sel:sourceId:AssetEntry' :: AssetEntry -> Maybe Text
sourceId} -> Maybe Text
sourceId) (\s :: AssetEntry
s@AssetEntry' {} Maybe Text
a -> AssetEntry
s {$sel:sourceId:AssetEntry' :: Maybe Text
sourceId = Maybe Text
a} :: AssetEntry)
assetEntry_assetType :: Lens.Lens' AssetEntry AssetType
assetEntry_assetType :: (AssetType -> f AssetType) -> AssetEntry -> f AssetEntry
assetEntry_assetType = (AssetEntry -> AssetType)
-> (AssetEntry -> AssetType -> AssetEntry)
-> Lens AssetEntry AssetEntry AssetType AssetType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {AssetType
assetType :: AssetType
$sel:assetType:AssetEntry' :: AssetEntry -> AssetType
assetType} -> AssetType
assetType) (\s :: AssetEntry
s@AssetEntry' {} AssetType
a -> AssetEntry
s {$sel:assetType:AssetEntry' :: AssetType
assetType = AssetType
a} :: AssetEntry)
assetEntry_createdAt :: Lens.Lens' AssetEntry Prelude.UTCTime
assetEntry_createdAt :: (UTCTime -> f UTCTime) -> AssetEntry -> f AssetEntry
assetEntry_createdAt = (AssetEntry -> POSIX)
-> (AssetEntry -> POSIX -> AssetEntry)
-> Lens AssetEntry AssetEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {POSIX
createdAt :: POSIX
$sel:createdAt:AssetEntry' :: AssetEntry -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AssetEntry
s@AssetEntry' {} POSIX
a -> AssetEntry
s {$sel:createdAt:AssetEntry' :: POSIX
createdAt = POSIX
a} :: AssetEntry) ((POSIX -> f POSIX) -> AssetEntry -> f AssetEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssetEntry
-> f AssetEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assetEntry_dataSetId :: Lens.Lens' AssetEntry Prelude.Text
assetEntry_dataSetId :: (Text -> f Text) -> AssetEntry -> f AssetEntry
assetEntry_dataSetId = (AssetEntry -> Text)
-> (AssetEntry -> Text -> AssetEntry)
-> Lens AssetEntry AssetEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {Text
dataSetId :: Text
$sel:dataSetId:AssetEntry' :: AssetEntry -> Text
dataSetId} -> Text
dataSetId) (\s :: AssetEntry
s@AssetEntry' {} Text
a -> AssetEntry
s {$sel:dataSetId:AssetEntry' :: Text
dataSetId = Text
a} :: AssetEntry)
assetEntry_id :: Lens.Lens' AssetEntry Prelude.Text
assetEntry_id :: (Text -> f Text) -> AssetEntry -> f AssetEntry
assetEntry_id = (AssetEntry -> Text)
-> (AssetEntry -> Text -> AssetEntry)
-> Lens AssetEntry AssetEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {Text
id :: Text
$sel:id:AssetEntry' :: AssetEntry -> Text
id} -> Text
id) (\s :: AssetEntry
s@AssetEntry' {} Text
a -> AssetEntry
s {$sel:id:AssetEntry' :: Text
id = Text
a} :: AssetEntry)
assetEntry_arn :: Lens.Lens' AssetEntry Prelude.Text
assetEntry_arn :: (Text -> f Text) -> AssetEntry -> f AssetEntry
assetEntry_arn = (AssetEntry -> Text)
-> (AssetEntry -> Text -> AssetEntry)
-> Lens AssetEntry AssetEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {Text
arn :: Text
$sel:arn:AssetEntry' :: AssetEntry -> Text
arn} -> Text
arn) (\s :: AssetEntry
s@AssetEntry' {} Text
a -> AssetEntry
s {$sel:arn:AssetEntry' :: Text
arn = Text
a} :: AssetEntry)
assetEntry_assetDetails :: Lens.Lens' AssetEntry AssetDetails
assetEntry_assetDetails :: (AssetDetails -> f AssetDetails) -> AssetEntry -> f AssetEntry
assetEntry_assetDetails = (AssetEntry -> AssetDetails)
-> (AssetEntry -> AssetDetails -> AssetEntry)
-> Lens AssetEntry AssetEntry AssetDetails AssetDetails
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {AssetDetails
assetDetails :: AssetDetails
$sel:assetDetails:AssetEntry' :: AssetEntry -> AssetDetails
assetDetails} -> AssetDetails
assetDetails) (\s :: AssetEntry
s@AssetEntry' {} AssetDetails
a -> AssetEntry
s {$sel:assetDetails:AssetEntry' :: AssetDetails
assetDetails = AssetDetails
a} :: AssetEntry)
assetEntry_updatedAt :: Lens.Lens' AssetEntry Prelude.UTCTime
assetEntry_updatedAt :: (UTCTime -> f UTCTime) -> AssetEntry -> f AssetEntry
assetEntry_updatedAt = (AssetEntry -> POSIX)
-> (AssetEntry -> POSIX -> AssetEntry)
-> Lens AssetEntry AssetEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {POSIX
updatedAt :: POSIX
$sel:updatedAt:AssetEntry' :: AssetEntry -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: AssetEntry
s@AssetEntry' {} POSIX
a -> AssetEntry
s {$sel:updatedAt:AssetEntry' :: POSIX
updatedAt = POSIX
a} :: AssetEntry) ((POSIX -> f POSIX) -> AssetEntry -> f AssetEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssetEntry
-> f AssetEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assetEntry_revisionId :: Lens.Lens' AssetEntry Prelude.Text
assetEntry_revisionId :: (Text -> f Text) -> AssetEntry -> f AssetEntry
assetEntry_revisionId = (AssetEntry -> Text)
-> (AssetEntry -> Text -> AssetEntry)
-> Lens AssetEntry AssetEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {Text
revisionId :: Text
$sel:revisionId:AssetEntry' :: AssetEntry -> Text
revisionId} -> Text
revisionId) (\s :: AssetEntry
s@AssetEntry' {} Text
a -> AssetEntry
s {$sel:revisionId:AssetEntry' :: Text
revisionId = Text
a} :: AssetEntry)
assetEntry_name :: Lens.Lens' AssetEntry Prelude.Text
assetEntry_name :: (Text -> f Text) -> AssetEntry -> f AssetEntry
assetEntry_name = (AssetEntry -> Text)
-> (AssetEntry -> Text -> AssetEntry)
-> Lens AssetEntry AssetEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetEntry' {Text
name :: Text
$sel:name:AssetEntry' :: AssetEntry -> Text
name} -> Text
name) (\s :: AssetEntry
s@AssetEntry' {} Text
a -> AssetEntry
s {$sel:name:AssetEntry' :: Text
name = Text
a} :: AssetEntry)
instance Core.FromJSON AssetEntry where
parseJSON :: Value -> Parser AssetEntry
parseJSON =
String
-> (Object -> Parser AssetEntry) -> Value -> Parser AssetEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssetEntry"
( \Object
x ->
Maybe Text
-> AssetType
-> POSIX
-> Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry
AssetEntry'
(Maybe Text
-> AssetType
-> POSIX
-> Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry)
-> Parser (Maybe Text)
-> Parser
(AssetType
-> POSIX
-> Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry)
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
"SourceId")
Parser
(AssetType
-> POSIX
-> Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry)
-> Parser AssetType
-> Parser
(POSIX
-> Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssetType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AssetType")
Parser
(POSIX
-> Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry)
-> Parser POSIX
-> Parser
(Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreatedAt")
Parser
(Text
-> Text
-> Text
-> AssetDetails
-> POSIX
-> Text
-> Text
-> AssetEntry)
-> Parser Text
-> Parser
(Text
-> Text -> AssetDetails -> POSIX -> Text -> Text -> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DataSetId")
Parser
(Text
-> Text -> AssetDetails -> POSIX -> Text -> Text -> AssetEntry)
-> Parser Text
-> Parser
(Text -> AssetDetails -> POSIX -> Text -> Text -> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
Parser
(Text -> AssetDetails -> POSIX -> Text -> Text -> AssetEntry)
-> Parser Text
-> Parser (AssetDetails -> POSIX -> Text -> Text -> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
Parser (AssetDetails -> POSIX -> Text -> Text -> AssetEntry)
-> Parser AssetDetails
-> Parser (POSIX -> Text -> Text -> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssetDetails
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AssetDetails")
Parser (POSIX -> Text -> Text -> AssetEntry)
-> Parser POSIX -> Parser (Text -> Text -> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UpdatedAt")
Parser (Text -> Text -> AssetEntry)
-> Parser Text -> Parser (Text -> AssetEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RevisionId")
Parser (Text -> AssetEntry) -> Parser Text -> Parser AssetEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
)
instance Prelude.Hashable AssetEntry
instance Prelude.NFData AssetEntry