{-# 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.CustomStepDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CustomStepDetails = CustomStepDetails'
{
CustomStepDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CustomStepDetails -> Maybe Natural
timeoutSeconds :: Prelude.Maybe Prelude.Natural,
CustomStepDetails -> Maybe Text
target :: Prelude.Maybe Prelude.Text
}
deriving (CustomStepDetails -> CustomStepDetails -> Bool
(CustomStepDetails -> CustomStepDetails -> Bool)
-> (CustomStepDetails -> CustomStepDetails -> Bool)
-> Eq CustomStepDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomStepDetails -> CustomStepDetails -> Bool
$c/= :: CustomStepDetails -> CustomStepDetails -> Bool
== :: CustomStepDetails -> CustomStepDetails -> Bool
$c== :: CustomStepDetails -> CustomStepDetails -> Bool
Prelude.Eq, ReadPrec [CustomStepDetails]
ReadPrec CustomStepDetails
Int -> ReadS CustomStepDetails
ReadS [CustomStepDetails]
(Int -> ReadS CustomStepDetails)
-> ReadS [CustomStepDetails]
-> ReadPrec CustomStepDetails
-> ReadPrec [CustomStepDetails]
-> Read CustomStepDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomStepDetails]
$creadListPrec :: ReadPrec [CustomStepDetails]
readPrec :: ReadPrec CustomStepDetails
$creadPrec :: ReadPrec CustomStepDetails
readList :: ReadS [CustomStepDetails]
$creadList :: ReadS [CustomStepDetails]
readsPrec :: Int -> ReadS CustomStepDetails
$creadsPrec :: Int -> ReadS CustomStepDetails
Prelude.Read, Int -> CustomStepDetails -> ShowS
[CustomStepDetails] -> ShowS
CustomStepDetails -> String
(Int -> CustomStepDetails -> ShowS)
-> (CustomStepDetails -> String)
-> ([CustomStepDetails] -> ShowS)
-> Show CustomStepDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomStepDetails] -> ShowS
$cshowList :: [CustomStepDetails] -> ShowS
show :: CustomStepDetails -> String
$cshow :: CustomStepDetails -> String
showsPrec :: Int -> CustomStepDetails -> ShowS
$cshowsPrec :: Int -> CustomStepDetails -> ShowS
Prelude.Show, (forall x. CustomStepDetails -> Rep CustomStepDetails x)
-> (forall x. Rep CustomStepDetails x -> CustomStepDetails)
-> Generic CustomStepDetails
forall x. Rep CustomStepDetails x -> CustomStepDetails
forall x. CustomStepDetails -> Rep CustomStepDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomStepDetails x -> CustomStepDetails
$cfrom :: forall x. CustomStepDetails -> Rep CustomStepDetails x
Prelude.Generic)
newCustomStepDetails ::
CustomStepDetails
newCustomStepDetails :: CustomStepDetails
newCustomStepDetails =
CustomStepDetails' :: Maybe Text -> Maybe Natural -> Maybe Text -> CustomStepDetails
CustomStepDetails'
{ $sel:name:CustomStepDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timeoutSeconds:CustomStepDetails' :: Maybe Natural
timeoutSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:target:CustomStepDetails' :: Maybe Text
target = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
customStepDetails_name :: Lens.Lens' CustomStepDetails (Prelude.Maybe Prelude.Text)
customStepDetails_name :: (Maybe Text -> f (Maybe Text))
-> CustomStepDetails -> f CustomStepDetails
customStepDetails_name = (CustomStepDetails -> Maybe Text)
-> (CustomStepDetails -> Maybe Text -> CustomStepDetails)
-> Lens
CustomStepDetails CustomStepDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomStepDetails' {Maybe Text
name :: Maybe Text
$sel:name:CustomStepDetails' :: CustomStepDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: CustomStepDetails
s@CustomStepDetails' {} Maybe Text
a -> CustomStepDetails
s {$sel:name:CustomStepDetails' :: Maybe Text
name = Maybe Text
a} :: CustomStepDetails)
customStepDetails_timeoutSeconds :: Lens.Lens' CustomStepDetails (Prelude.Maybe Prelude.Natural)
customStepDetails_timeoutSeconds :: (Maybe Natural -> f (Maybe Natural))
-> CustomStepDetails -> f CustomStepDetails
customStepDetails_timeoutSeconds = (CustomStepDetails -> Maybe Natural)
-> (CustomStepDetails -> Maybe Natural -> CustomStepDetails)
-> Lens
CustomStepDetails CustomStepDetails (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomStepDetails' {Maybe Natural
timeoutSeconds :: Maybe Natural
$sel:timeoutSeconds:CustomStepDetails' :: CustomStepDetails -> Maybe Natural
timeoutSeconds} -> Maybe Natural
timeoutSeconds) (\s :: CustomStepDetails
s@CustomStepDetails' {} Maybe Natural
a -> CustomStepDetails
s {$sel:timeoutSeconds:CustomStepDetails' :: Maybe Natural
timeoutSeconds = Maybe Natural
a} :: CustomStepDetails)
customStepDetails_target :: Lens.Lens' CustomStepDetails (Prelude.Maybe Prelude.Text)
customStepDetails_target :: (Maybe Text -> f (Maybe Text))
-> CustomStepDetails -> f CustomStepDetails
customStepDetails_target = (CustomStepDetails -> Maybe Text)
-> (CustomStepDetails -> Maybe Text -> CustomStepDetails)
-> Lens
CustomStepDetails CustomStepDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomStepDetails' {Maybe Text
target :: Maybe Text
$sel:target:CustomStepDetails' :: CustomStepDetails -> Maybe Text
target} -> Maybe Text
target) (\s :: CustomStepDetails
s@CustomStepDetails' {} Maybe Text
a -> CustomStepDetails
s {$sel:target:CustomStepDetails' :: Maybe Text
target = Maybe Text
a} :: CustomStepDetails)
instance Core.FromJSON CustomStepDetails where
parseJSON :: Value -> Parser CustomStepDetails
parseJSON =
String
-> (Object -> Parser CustomStepDetails)
-> Value
-> Parser CustomStepDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CustomStepDetails"
( \Object
x ->
Maybe Text -> Maybe Natural -> Maybe Text -> CustomStepDetails
CustomStepDetails'
(Maybe Text -> Maybe Natural -> Maybe Text -> CustomStepDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Natural -> Maybe Text -> CustomStepDetails)
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
"Name")
Parser (Maybe Natural -> Maybe Text -> CustomStepDetails)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> CustomStepDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimeoutSeconds")
Parser (Maybe Text -> CustomStepDetails)
-> Parser (Maybe Text) -> Parser CustomStepDetails
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
"Target")
)
instance Prelude.Hashable CustomStepDetails
instance Prelude.NFData CustomStepDetails
instance Core.ToJSON CustomStepDetails where
toJSON :: CustomStepDetails -> Value
toJSON CustomStepDetails' {Maybe Natural
Maybe Text
target :: Maybe Text
timeoutSeconds :: Maybe Natural
name :: Maybe Text
$sel:target:CustomStepDetails' :: CustomStepDetails -> Maybe Text
$sel:timeoutSeconds:CustomStepDetails' :: CustomStepDetails -> Maybe Natural
$sel:name:CustomStepDetails' :: CustomStepDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"TimeoutSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeoutSeconds,
(Text
"Target" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
target
]
)