{-# 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.IoT.Types.TransferData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TransferData = TransferData'
{
TransferData -> Maybe POSIX
transferDate :: Prelude.Maybe Core.POSIX,
TransferData -> Maybe POSIX
acceptDate :: Prelude.Maybe Core.POSIX,
TransferData -> Maybe Text
transferMessage :: Prelude.Maybe Prelude.Text,
TransferData -> Maybe POSIX
rejectDate :: Prelude.Maybe Core.POSIX,
TransferData -> Maybe Text
rejectReason :: Prelude.Maybe Prelude.Text
}
deriving (TransferData -> TransferData -> Bool
(TransferData -> TransferData -> Bool)
-> (TransferData -> TransferData -> Bool) -> Eq TransferData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferData -> TransferData -> Bool
$c/= :: TransferData -> TransferData -> Bool
== :: TransferData -> TransferData -> Bool
$c== :: TransferData -> TransferData -> Bool
Prelude.Eq, ReadPrec [TransferData]
ReadPrec TransferData
Int -> ReadS TransferData
ReadS [TransferData]
(Int -> ReadS TransferData)
-> ReadS [TransferData]
-> ReadPrec TransferData
-> ReadPrec [TransferData]
-> Read TransferData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferData]
$creadListPrec :: ReadPrec [TransferData]
readPrec :: ReadPrec TransferData
$creadPrec :: ReadPrec TransferData
readList :: ReadS [TransferData]
$creadList :: ReadS [TransferData]
readsPrec :: Int -> ReadS TransferData
$creadsPrec :: Int -> ReadS TransferData
Prelude.Read, Int -> TransferData -> ShowS
[TransferData] -> ShowS
TransferData -> String
(Int -> TransferData -> ShowS)
-> (TransferData -> String)
-> ([TransferData] -> ShowS)
-> Show TransferData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferData] -> ShowS
$cshowList :: [TransferData] -> ShowS
show :: TransferData -> String
$cshow :: TransferData -> String
showsPrec :: Int -> TransferData -> ShowS
$cshowsPrec :: Int -> TransferData -> ShowS
Prelude.Show, (forall x. TransferData -> Rep TransferData x)
-> (forall x. Rep TransferData x -> TransferData)
-> Generic TransferData
forall x. Rep TransferData x -> TransferData
forall x. TransferData -> Rep TransferData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TransferData x -> TransferData
$cfrom :: forall x. TransferData -> Rep TransferData x
Prelude.Generic)
newTransferData ::
TransferData
newTransferData :: TransferData
newTransferData =
TransferData' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> TransferData
TransferData'
{ $sel:transferDate:TransferData' :: Maybe POSIX
transferDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:acceptDate:TransferData' :: Maybe POSIX
acceptDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:transferMessage:TransferData' :: Maybe Text
transferMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:rejectDate:TransferData' :: Maybe POSIX
rejectDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:rejectReason:TransferData' :: Maybe Text
rejectReason = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
transferData_transferDate :: Lens.Lens' TransferData (Prelude.Maybe Prelude.UTCTime)
transferData_transferDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TransferData -> f TransferData
transferData_transferDate = (TransferData -> Maybe POSIX)
-> (TransferData -> Maybe POSIX -> TransferData)
-> Lens TransferData TransferData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferData' {Maybe POSIX
transferDate :: Maybe POSIX
$sel:transferDate:TransferData' :: TransferData -> Maybe POSIX
transferDate} -> Maybe POSIX
transferDate) (\s :: TransferData
s@TransferData' {} Maybe POSIX
a -> TransferData
s {$sel:transferDate:TransferData' :: Maybe POSIX
transferDate = Maybe POSIX
a} :: TransferData) ((Maybe POSIX -> f (Maybe POSIX))
-> TransferData -> f TransferData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TransferData
-> f TransferData
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
transferData_acceptDate :: Lens.Lens' TransferData (Prelude.Maybe Prelude.UTCTime)
transferData_acceptDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TransferData -> f TransferData
transferData_acceptDate = (TransferData -> Maybe POSIX)
-> (TransferData -> Maybe POSIX -> TransferData)
-> Lens TransferData TransferData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferData' {Maybe POSIX
acceptDate :: Maybe POSIX
$sel:acceptDate:TransferData' :: TransferData -> Maybe POSIX
acceptDate} -> Maybe POSIX
acceptDate) (\s :: TransferData
s@TransferData' {} Maybe POSIX
a -> TransferData
s {$sel:acceptDate:TransferData' :: Maybe POSIX
acceptDate = Maybe POSIX
a} :: TransferData) ((Maybe POSIX -> f (Maybe POSIX))
-> TransferData -> f TransferData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TransferData
-> f TransferData
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
transferData_transferMessage :: Lens.Lens' TransferData (Prelude.Maybe Prelude.Text)
transferData_transferMessage :: (Maybe Text -> f (Maybe Text)) -> TransferData -> f TransferData
transferData_transferMessage = (TransferData -> Maybe Text)
-> (TransferData -> Maybe Text -> TransferData)
-> Lens TransferData TransferData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferData' {Maybe Text
transferMessage :: Maybe Text
$sel:transferMessage:TransferData' :: TransferData -> Maybe Text
transferMessage} -> Maybe Text
transferMessage) (\s :: TransferData
s@TransferData' {} Maybe Text
a -> TransferData
s {$sel:transferMessage:TransferData' :: Maybe Text
transferMessage = Maybe Text
a} :: TransferData)
transferData_rejectDate :: Lens.Lens' TransferData (Prelude.Maybe Prelude.UTCTime)
transferData_rejectDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TransferData -> f TransferData
transferData_rejectDate = (TransferData -> Maybe POSIX)
-> (TransferData -> Maybe POSIX -> TransferData)
-> Lens TransferData TransferData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferData' {Maybe POSIX
rejectDate :: Maybe POSIX
$sel:rejectDate:TransferData' :: TransferData -> Maybe POSIX
rejectDate} -> Maybe POSIX
rejectDate) (\s :: TransferData
s@TransferData' {} Maybe POSIX
a -> TransferData
s {$sel:rejectDate:TransferData' :: Maybe POSIX
rejectDate = Maybe POSIX
a} :: TransferData) ((Maybe POSIX -> f (Maybe POSIX))
-> TransferData -> f TransferData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TransferData
-> f TransferData
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
transferData_rejectReason :: Lens.Lens' TransferData (Prelude.Maybe Prelude.Text)
transferData_rejectReason :: (Maybe Text -> f (Maybe Text)) -> TransferData -> f TransferData
transferData_rejectReason = (TransferData -> Maybe Text)
-> (TransferData -> Maybe Text -> TransferData)
-> Lens TransferData TransferData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferData' {Maybe Text
rejectReason :: Maybe Text
$sel:rejectReason:TransferData' :: TransferData -> Maybe Text
rejectReason} -> Maybe Text
rejectReason) (\s :: TransferData
s@TransferData' {} Maybe Text
a -> TransferData
s {$sel:rejectReason:TransferData' :: Maybe Text
rejectReason = Maybe Text
a} :: TransferData)
instance Core.FromJSON TransferData where
parseJSON :: Value -> Parser TransferData
parseJSON =
String
-> (Object -> Parser TransferData) -> Value -> Parser TransferData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TransferData"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> TransferData
TransferData'
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> TransferData)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe POSIX -> Maybe Text -> TransferData)
forall (f :: * -> *) a b. Functor 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
"transferDate")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe POSIX -> Maybe Text -> TransferData)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> TransferData)
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
"acceptDate")
Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> TransferData)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> TransferData)
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
"transferMessage")
Parser (Maybe POSIX -> Maybe Text -> TransferData)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> TransferData)
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
"rejectDate")
Parser (Maybe Text -> TransferData)
-> Parser (Maybe Text) -> Parser TransferData
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
"rejectReason")
)
instance Prelude.Hashable TransferData
instance Prelude.NFData TransferData