{-# 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.Transfer.Types.ListedExecution where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transfer.Types.ExecutionStatus
import Amazonka.Transfer.Types.FileLocation
import Amazonka.Transfer.Types.ServiceMetadata
data ListedExecution = ListedExecution'
{
ListedExecution -> Maybe ExecutionStatus
status :: Prelude.Maybe ExecutionStatus,
ListedExecution -> Maybe Text
executionId :: Prelude.Maybe Prelude.Text,
ListedExecution -> Maybe FileLocation
initialFileLocation :: Prelude.Maybe FileLocation,
ListedExecution -> Maybe ServiceMetadata
serviceMetadata :: Prelude.Maybe ServiceMetadata
}
deriving (ListedExecution -> ListedExecution -> Bool
(ListedExecution -> ListedExecution -> Bool)
-> (ListedExecution -> ListedExecution -> Bool)
-> Eq ListedExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListedExecution -> ListedExecution -> Bool
$c/= :: ListedExecution -> ListedExecution -> Bool
== :: ListedExecution -> ListedExecution -> Bool
$c== :: ListedExecution -> ListedExecution -> Bool
Prelude.Eq, ReadPrec [ListedExecution]
ReadPrec ListedExecution
Int -> ReadS ListedExecution
ReadS [ListedExecution]
(Int -> ReadS ListedExecution)
-> ReadS [ListedExecution]
-> ReadPrec ListedExecution
-> ReadPrec [ListedExecution]
-> Read ListedExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListedExecution]
$creadListPrec :: ReadPrec [ListedExecution]
readPrec :: ReadPrec ListedExecution
$creadPrec :: ReadPrec ListedExecution
readList :: ReadS [ListedExecution]
$creadList :: ReadS [ListedExecution]
readsPrec :: Int -> ReadS ListedExecution
$creadsPrec :: Int -> ReadS ListedExecution
Prelude.Read, Int -> ListedExecution -> ShowS
[ListedExecution] -> ShowS
ListedExecution -> String
(Int -> ListedExecution -> ShowS)
-> (ListedExecution -> String)
-> ([ListedExecution] -> ShowS)
-> Show ListedExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListedExecution] -> ShowS
$cshowList :: [ListedExecution] -> ShowS
show :: ListedExecution -> String
$cshow :: ListedExecution -> String
showsPrec :: Int -> ListedExecution -> ShowS
$cshowsPrec :: Int -> ListedExecution -> ShowS
Prelude.Show, (forall x. ListedExecution -> Rep ListedExecution x)
-> (forall x. Rep ListedExecution x -> ListedExecution)
-> Generic ListedExecution
forall x. Rep ListedExecution x -> ListedExecution
forall x. ListedExecution -> Rep ListedExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListedExecution x -> ListedExecution
$cfrom :: forall x. ListedExecution -> Rep ListedExecution x
Prelude.Generic)
newListedExecution ::
ListedExecution
newListedExecution :: ListedExecution
newListedExecution =
ListedExecution' :: Maybe ExecutionStatus
-> Maybe Text
-> Maybe FileLocation
-> Maybe ServiceMetadata
-> ListedExecution
ListedExecution'
{ $sel:status:ListedExecution' :: Maybe ExecutionStatus
status = Maybe ExecutionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:executionId:ListedExecution' :: Maybe Text
executionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:initialFileLocation:ListedExecution' :: Maybe FileLocation
initialFileLocation = Maybe FileLocation
forall a. Maybe a
Prelude.Nothing,
$sel:serviceMetadata:ListedExecution' :: Maybe ServiceMetadata
serviceMetadata = Maybe ServiceMetadata
forall a. Maybe a
Prelude.Nothing
}
listedExecution_status :: Lens.Lens' ListedExecution (Prelude.Maybe ExecutionStatus)
listedExecution_status :: (Maybe ExecutionStatus -> f (Maybe ExecutionStatus))
-> ListedExecution -> f ListedExecution
listedExecution_status = (ListedExecution -> Maybe ExecutionStatus)
-> (ListedExecution -> Maybe ExecutionStatus -> ListedExecution)
-> Lens
ListedExecution
ListedExecution
(Maybe ExecutionStatus)
(Maybe ExecutionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedExecution' {Maybe ExecutionStatus
status :: Maybe ExecutionStatus
$sel:status:ListedExecution' :: ListedExecution -> Maybe ExecutionStatus
status} -> Maybe ExecutionStatus
status) (\s :: ListedExecution
s@ListedExecution' {} Maybe ExecutionStatus
a -> ListedExecution
s {$sel:status:ListedExecution' :: Maybe ExecutionStatus
status = Maybe ExecutionStatus
a} :: ListedExecution)
listedExecution_executionId :: Lens.Lens' ListedExecution (Prelude.Maybe Prelude.Text)
listedExecution_executionId :: (Maybe Text -> f (Maybe Text))
-> ListedExecution -> f ListedExecution
listedExecution_executionId = (ListedExecution -> Maybe Text)
-> (ListedExecution -> Maybe Text -> ListedExecution)
-> Lens ListedExecution ListedExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedExecution' {Maybe Text
executionId :: Maybe Text
$sel:executionId:ListedExecution' :: ListedExecution -> Maybe Text
executionId} -> Maybe Text
executionId) (\s :: ListedExecution
s@ListedExecution' {} Maybe Text
a -> ListedExecution
s {$sel:executionId:ListedExecution' :: Maybe Text
executionId = Maybe Text
a} :: ListedExecution)
listedExecution_initialFileLocation :: Lens.Lens' ListedExecution (Prelude.Maybe FileLocation)
listedExecution_initialFileLocation :: (Maybe FileLocation -> f (Maybe FileLocation))
-> ListedExecution -> f ListedExecution
listedExecution_initialFileLocation = (ListedExecution -> Maybe FileLocation)
-> (ListedExecution -> Maybe FileLocation -> ListedExecution)
-> Lens
ListedExecution
ListedExecution
(Maybe FileLocation)
(Maybe FileLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedExecution' {Maybe FileLocation
initialFileLocation :: Maybe FileLocation
$sel:initialFileLocation:ListedExecution' :: ListedExecution -> Maybe FileLocation
initialFileLocation} -> Maybe FileLocation
initialFileLocation) (\s :: ListedExecution
s@ListedExecution' {} Maybe FileLocation
a -> ListedExecution
s {$sel:initialFileLocation:ListedExecution' :: Maybe FileLocation
initialFileLocation = Maybe FileLocation
a} :: ListedExecution)
listedExecution_serviceMetadata :: Lens.Lens' ListedExecution (Prelude.Maybe ServiceMetadata)
listedExecution_serviceMetadata :: (Maybe ServiceMetadata -> f (Maybe ServiceMetadata))
-> ListedExecution -> f ListedExecution
listedExecution_serviceMetadata = (ListedExecution -> Maybe ServiceMetadata)
-> (ListedExecution -> Maybe ServiceMetadata -> ListedExecution)
-> Lens
ListedExecution
ListedExecution
(Maybe ServiceMetadata)
(Maybe ServiceMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedExecution' {Maybe ServiceMetadata
serviceMetadata :: Maybe ServiceMetadata
$sel:serviceMetadata:ListedExecution' :: ListedExecution -> Maybe ServiceMetadata
serviceMetadata} -> Maybe ServiceMetadata
serviceMetadata) (\s :: ListedExecution
s@ListedExecution' {} Maybe ServiceMetadata
a -> ListedExecution
s {$sel:serviceMetadata:ListedExecution' :: Maybe ServiceMetadata
serviceMetadata = Maybe ServiceMetadata
a} :: ListedExecution)
instance Core.FromJSON ListedExecution where
parseJSON :: Value -> Parser ListedExecution
parseJSON =
String
-> (Object -> Parser ListedExecution)
-> Value
-> Parser ListedExecution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ListedExecution"
( \Object
x ->
Maybe ExecutionStatus
-> Maybe Text
-> Maybe FileLocation
-> Maybe ServiceMetadata
-> ListedExecution
ListedExecution'
(Maybe ExecutionStatus
-> Maybe Text
-> Maybe FileLocation
-> Maybe ServiceMetadata
-> ListedExecution)
-> Parser (Maybe ExecutionStatus)
-> Parser
(Maybe Text
-> Maybe FileLocation -> Maybe ServiceMetadata -> ListedExecution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ExecutionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe FileLocation -> Maybe ServiceMetadata -> ListedExecution)
-> Parser (Maybe Text)
-> Parser
(Maybe FileLocation -> Maybe ServiceMetadata -> ListedExecution)
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
"ExecutionId")
Parser
(Maybe FileLocation -> Maybe ServiceMetadata -> ListedExecution)
-> Parser (Maybe FileLocation)
-> Parser (Maybe ServiceMetadata -> ListedExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FileLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InitialFileLocation")
Parser (Maybe ServiceMetadata -> ListedExecution)
-> Parser (Maybe ServiceMetadata) -> Parser ListedExecution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServiceMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceMetadata")
)
instance Prelude.Hashable ListedExecution
instance Prelude.NFData ListedExecution