{-# 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.Action where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataExchange.Types.AutoExportRevisionToS3RequestDetails
import qualified Amazonka.Prelude as Prelude
data Action = Action'
{
Action -> Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3 :: Prelude.Maybe AutoExportRevisionToS3RequestDetails
}
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:exportRevisionToS3:Action' :: Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3 = forall a. Maybe a
Prelude.Nothing}
action_exportRevisionToS3 :: Lens.Lens' Action (Prelude.Maybe AutoExportRevisionToS3RequestDetails)
action_exportRevisionToS3 :: Lens' Action (Maybe AutoExportRevisionToS3RequestDetails)
action_exportRevisionToS3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3 :: Maybe AutoExportRevisionToS3RequestDetails
$sel:exportRevisionToS3:Action' :: Action -> Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3} -> Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3) (\s :: Action
s@Action' {} Maybe AutoExportRevisionToS3RequestDetails
a -> Action
s {$sel:exportRevisionToS3:Action' :: Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3 = Maybe AutoExportRevisionToS3RequestDetails
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 AutoExportRevisionToS3RequestDetails -> 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
"ExportRevisionToS3")
)
instance Prelude.Hashable Action where
hashWithSalt :: Int -> Action -> Int
hashWithSalt Int
_salt Action' {Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3 :: Maybe AutoExportRevisionToS3RequestDetails
$sel:exportRevisionToS3:Action' :: Action -> Maybe AutoExportRevisionToS3RequestDetails
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3
instance Prelude.NFData Action where
rnf :: Action -> ()
rnf Action' {Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3 :: Maybe AutoExportRevisionToS3RequestDetails
$sel:exportRevisionToS3:Action' :: Action -> Maybe AutoExportRevisionToS3RequestDetails
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3
instance Data.ToJSON Action where
toJSON :: Action -> Value
toJSON Action' {Maybe AutoExportRevisionToS3RequestDetails
exportRevisionToS3 :: Maybe AutoExportRevisionToS3RequestDetails
$sel:exportRevisionToS3:Action' :: Action -> Maybe AutoExportRevisionToS3RequestDetails
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ExportRevisionToS3" 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 AutoExportRevisionToS3RequestDetails
exportRevisionToS3
]
)