{-# 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.Glue.Types.Action where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.NotificationProperty
import qualified Amazonka.Prelude as Prelude
data Action = Action'
{
Action -> Maybe (HashMap Text Text)
arguments :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Action -> Maybe Text
crawlerName :: Prelude.Maybe Prelude.Text,
Action -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
Action -> Maybe NotificationProperty
notificationProperty :: Prelude.Maybe NotificationProperty,
Action -> Maybe Text
securityConfiguration :: Prelude.Maybe Prelude.Text,
Action -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural
}
deriving (Action -> Action -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Action -> Action -> Bool
$c/= :: Action -> Action -> Bool
== :: Action -> Action -> Bool
$c== :: Action -> Action -> Bool
Prelude.Eq, ReadPrec [Action]
ReadPrec Action
Int -> ReadS Action
ReadS [Action]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Action]
$creadListPrec :: ReadPrec [Action]
readPrec :: ReadPrec Action
$creadPrec :: ReadPrec Action
readList :: ReadS [Action]
$creadList :: ReadS [Action]
readsPrec :: Int -> ReadS Action
$creadsPrec :: Int -> ReadS Action
Prelude.Read, Int -> Action -> ShowS
[Action] -> ShowS
Action -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Action] -> ShowS
$cshowList :: [Action] -> ShowS
show :: Action -> String
$cshow :: Action -> String
showsPrec :: Int -> Action -> ShowS
$cshowsPrec :: Int -> Action -> ShowS
Prelude.Show, forall x. Rep Action x -> Action
forall x. Action -> Rep Action x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Action x -> Action
$cfrom :: forall x. Action -> Rep Action x
Prelude.Generic)
newAction ::
Action
newAction :: Action
newAction =
Action'
{ $sel:arguments:Action' :: Maybe (HashMap Text Text)
arguments = forall a. Maybe a
Prelude.Nothing,
$sel:crawlerName:Action' :: Maybe Text
crawlerName = forall a. Maybe a
Prelude.Nothing,
$sel:jobName:Action' :: Maybe Text
jobName = forall a. Maybe a
Prelude.Nothing,
$sel:notificationProperty:Action' :: Maybe NotificationProperty
notificationProperty = forall a. Maybe a
Prelude.Nothing,
$sel:securityConfiguration:Action' :: Maybe Text
securityConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:timeout:Action' :: Maybe Natural
timeout = forall a. Maybe a
Prelude.Nothing
}
action_arguments :: Lens.Lens' Action (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
action_arguments :: Lens' Action (Maybe (HashMap Text Text))
action_arguments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe (HashMap Text Text)
arguments :: Maybe (HashMap Text Text)
$sel:arguments:Action' :: Action -> Maybe (HashMap Text Text)
arguments} -> Maybe (HashMap Text Text)
arguments) (\s :: Action
s@Action' {} Maybe (HashMap Text Text)
a -> Action
s {$sel:arguments:Action' :: Maybe (HashMap Text Text)
arguments = Maybe (HashMap Text Text)
a} :: Action) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
action_crawlerName :: Lens.Lens' Action (Prelude.Maybe Prelude.Text)
action_crawlerName :: Lens' Action (Maybe Text)
action_crawlerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe Text
crawlerName :: Maybe Text
$sel:crawlerName:Action' :: Action -> Maybe Text
crawlerName} -> Maybe Text
crawlerName) (\s :: Action
s@Action' {} Maybe Text
a -> Action
s {$sel:crawlerName:Action' :: Maybe Text
crawlerName = Maybe Text
a} :: Action)
action_jobName :: Lens.Lens' Action (Prelude.Maybe Prelude.Text)
action_jobName :: Lens' Action (Maybe Text)
action_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe Text
jobName :: Maybe Text
$sel:jobName:Action' :: Action -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: Action
s@Action' {} Maybe Text
a -> Action
s {$sel:jobName:Action' :: Maybe Text
jobName = Maybe Text
a} :: Action)
action_notificationProperty :: Lens.Lens' Action (Prelude.Maybe NotificationProperty)
action_notificationProperty :: Lens' Action (Maybe NotificationProperty)
action_notificationProperty = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe NotificationProperty
notificationProperty :: Maybe NotificationProperty
$sel:notificationProperty:Action' :: Action -> Maybe NotificationProperty
notificationProperty} -> Maybe NotificationProperty
notificationProperty) (\s :: Action
s@Action' {} Maybe NotificationProperty
a -> Action
s {$sel:notificationProperty:Action' :: Maybe NotificationProperty
notificationProperty = Maybe NotificationProperty
a} :: Action)
action_securityConfiguration :: Lens.Lens' Action (Prelude.Maybe Prelude.Text)
action_securityConfiguration :: Lens' Action (Maybe Text)
action_securityConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe Text
securityConfiguration :: Maybe Text
$sel:securityConfiguration:Action' :: Action -> Maybe Text
securityConfiguration} -> Maybe Text
securityConfiguration) (\s :: Action
s@Action' {} Maybe Text
a -> Action
s {$sel:securityConfiguration:Action' :: Maybe Text
securityConfiguration = Maybe Text
a} :: Action)
action_timeout :: Lens.Lens' Action (Prelude.Maybe Prelude.Natural)
action_timeout :: Lens' Action (Maybe Natural)
action_timeout = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:Action' :: Action -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: Action
s@Action' {} Maybe Natural
a -> Action
s {$sel:timeout:Action' :: Maybe Natural
timeout = Maybe Natural
a} :: Action)
instance Data.FromJSON Action where
parseJSON :: Value -> Parser Action
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Action"
( \Object
x ->
Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe NotificationProperty
-> Maybe Text
-> Maybe Natural
-> Action
Action'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arguments" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CrawlerName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"JobName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NotificationProperty")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecurityConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Timeout")
)
instance Prelude.Hashable Action where
hashWithSalt :: Int -> Action -> Int
hashWithSalt Int
_salt Action' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe NotificationProperty
timeout :: Maybe Natural
securityConfiguration :: Maybe Text
notificationProperty :: Maybe NotificationProperty
jobName :: Maybe Text
crawlerName :: Maybe Text
arguments :: Maybe (HashMap Text Text)
$sel:timeout:Action' :: Action -> Maybe Natural
$sel:securityConfiguration:Action' :: Action -> Maybe Text
$sel:notificationProperty:Action' :: Action -> Maybe NotificationProperty
$sel:jobName:Action' :: Action -> Maybe Text
$sel:crawlerName:Action' :: Action -> Maybe Text
$sel:arguments:Action' :: Action -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
arguments
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
crawlerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotificationProperty
notificationProperty
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
securityConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeout
instance Prelude.NFData Action where
rnf :: Action -> ()
rnf Action' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe NotificationProperty
timeout :: Maybe Natural
securityConfiguration :: Maybe Text
notificationProperty :: Maybe NotificationProperty
jobName :: Maybe Text
crawlerName :: Maybe Text
arguments :: Maybe (HashMap Text Text)
$sel:timeout:Action' :: Action -> Maybe Natural
$sel:securityConfiguration:Action' :: Action -> Maybe Text
$sel:notificationProperty:Action' :: Action -> Maybe NotificationProperty
$sel:jobName:Action' :: Action -> Maybe Text
$sel:crawlerName:Action' :: Action -> Maybe Text
$sel:arguments:Action' :: Action -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
arguments
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
crawlerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotificationProperty
notificationProperty
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeout
instance Data.ToJSON Action where
toJSON :: Action -> Value
toJSON Action' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe NotificationProperty
timeout :: Maybe Natural
securityConfiguration :: Maybe Text
notificationProperty :: Maybe NotificationProperty
jobName :: Maybe Text
crawlerName :: Maybe Text
arguments :: Maybe (HashMap Text Text)
$sel:timeout:Action' :: Action -> Maybe Natural
$sel:securityConfiguration:Action' :: Action -> Maybe Text
$sel:notificationProperty:Action' :: Action -> Maybe NotificationProperty
$sel:jobName:Action' :: Action -> Maybe Text
$sel:crawlerName:Action' :: Action -> Maybe Text
$sel:arguments:Action' :: Action -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Arguments" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
arguments,
(Key
"CrawlerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
crawlerName,
(Key
"JobName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobName,
(Key
"NotificationProperty" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationProperty
notificationProperty,
(Key
"SecurityConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
securityConfiguration,
(Key
"Timeout" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeout
]
)