{-# 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.IoTAnalytics.Types.ContainerDatasetAction where
import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.ResourceConfiguration
import Amazonka.IoTAnalytics.Types.Variable
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContainerDatasetAction = ContainerDatasetAction'
{
ContainerDatasetAction -> Maybe [Variable]
variables :: Prelude.Maybe [Variable],
ContainerDatasetAction -> Text
image :: Prelude.Text,
ContainerDatasetAction -> Text
executionRoleArn :: Prelude.Text,
ContainerDatasetAction -> ResourceConfiguration
resourceConfiguration :: ResourceConfiguration
}
deriving (ContainerDatasetAction -> ContainerDatasetAction -> Bool
(ContainerDatasetAction -> ContainerDatasetAction -> Bool)
-> (ContainerDatasetAction -> ContainerDatasetAction -> Bool)
-> Eq ContainerDatasetAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerDatasetAction -> ContainerDatasetAction -> Bool
$c/= :: ContainerDatasetAction -> ContainerDatasetAction -> Bool
== :: ContainerDatasetAction -> ContainerDatasetAction -> Bool
$c== :: ContainerDatasetAction -> ContainerDatasetAction -> Bool
Prelude.Eq, ReadPrec [ContainerDatasetAction]
ReadPrec ContainerDatasetAction
Int -> ReadS ContainerDatasetAction
ReadS [ContainerDatasetAction]
(Int -> ReadS ContainerDatasetAction)
-> ReadS [ContainerDatasetAction]
-> ReadPrec ContainerDatasetAction
-> ReadPrec [ContainerDatasetAction]
-> Read ContainerDatasetAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerDatasetAction]
$creadListPrec :: ReadPrec [ContainerDatasetAction]
readPrec :: ReadPrec ContainerDatasetAction
$creadPrec :: ReadPrec ContainerDatasetAction
readList :: ReadS [ContainerDatasetAction]
$creadList :: ReadS [ContainerDatasetAction]
readsPrec :: Int -> ReadS ContainerDatasetAction
$creadsPrec :: Int -> ReadS ContainerDatasetAction
Prelude.Read, Int -> ContainerDatasetAction -> ShowS
[ContainerDatasetAction] -> ShowS
ContainerDatasetAction -> String
(Int -> ContainerDatasetAction -> ShowS)
-> (ContainerDatasetAction -> String)
-> ([ContainerDatasetAction] -> ShowS)
-> Show ContainerDatasetAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerDatasetAction] -> ShowS
$cshowList :: [ContainerDatasetAction] -> ShowS
show :: ContainerDatasetAction -> String
$cshow :: ContainerDatasetAction -> String
showsPrec :: Int -> ContainerDatasetAction -> ShowS
$cshowsPrec :: Int -> ContainerDatasetAction -> ShowS
Prelude.Show, (forall x. ContainerDatasetAction -> Rep ContainerDatasetAction x)
-> (forall x.
Rep ContainerDatasetAction x -> ContainerDatasetAction)
-> Generic ContainerDatasetAction
forall x. Rep ContainerDatasetAction x -> ContainerDatasetAction
forall x. ContainerDatasetAction -> Rep ContainerDatasetAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerDatasetAction x -> ContainerDatasetAction
$cfrom :: forall x. ContainerDatasetAction -> Rep ContainerDatasetAction x
Prelude.Generic)
newContainerDatasetAction ::
Prelude.Text ->
Prelude.Text ->
ResourceConfiguration ->
ContainerDatasetAction
newContainerDatasetAction :: Text -> Text -> ResourceConfiguration -> ContainerDatasetAction
newContainerDatasetAction
Text
pImage_
Text
pExecutionRoleArn_
ResourceConfiguration
pResourceConfiguration_ =
ContainerDatasetAction' :: Maybe [Variable]
-> Text -> Text -> ResourceConfiguration -> ContainerDatasetAction
ContainerDatasetAction'
{ $sel:variables:ContainerDatasetAction' :: Maybe [Variable]
variables =
Maybe [Variable]
forall a. Maybe a
Prelude.Nothing,
$sel:image:ContainerDatasetAction' :: Text
image = Text
pImage_,
$sel:executionRoleArn:ContainerDatasetAction' :: Text
executionRoleArn = Text
pExecutionRoleArn_,
$sel:resourceConfiguration:ContainerDatasetAction' :: ResourceConfiguration
resourceConfiguration = ResourceConfiguration
pResourceConfiguration_
}
containerDatasetAction_variables :: Lens.Lens' ContainerDatasetAction (Prelude.Maybe [Variable])
containerDatasetAction_variables :: (Maybe [Variable] -> f (Maybe [Variable]))
-> ContainerDatasetAction -> f ContainerDatasetAction
containerDatasetAction_variables = (ContainerDatasetAction -> Maybe [Variable])
-> (ContainerDatasetAction
-> Maybe [Variable] -> ContainerDatasetAction)
-> Lens
ContainerDatasetAction
ContainerDatasetAction
(Maybe [Variable])
(Maybe [Variable])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDatasetAction' {Maybe [Variable]
variables :: Maybe [Variable]
$sel:variables:ContainerDatasetAction' :: ContainerDatasetAction -> Maybe [Variable]
variables} -> Maybe [Variable]
variables) (\s :: ContainerDatasetAction
s@ContainerDatasetAction' {} Maybe [Variable]
a -> ContainerDatasetAction
s {$sel:variables:ContainerDatasetAction' :: Maybe [Variable]
variables = Maybe [Variable]
a} :: ContainerDatasetAction) ((Maybe [Variable] -> f (Maybe [Variable]))
-> ContainerDatasetAction -> f ContainerDatasetAction)
-> ((Maybe [Variable] -> f (Maybe [Variable]))
-> Maybe [Variable] -> f (Maybe [Variable]))
-> (Maybe [Variable] -> f (Maybe [Variable]))
-> ContainerDatasetAction
-> f ContainerDatasetAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Variable] [Variable] [Variable] [Variable]
-> Iso
(Maybe [Variable])
(Maybe [Variable])
(Maybe [Variable])
(Maybe [Variable])
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 [Variable] [Variable] [Variable] [Variable]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
containerDatasetAction_image :: Lens.Lens' ContainerDatasetAction Prelude.Text
containerDatasetAction_image :: (Text -> f Text)
-> ContainerDatasetAction -> f ContainerDatasetAction
containerDatasetAction_image = (ContainerDatasetAction -> Text)
-> (ContainerDatasetAction -> Text -> ContainerDatasetAction)
-> Lens ContainerDatasetAction ContainerDatasetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDatasetAction' {Text
image :: Text
$sel:image:ContainerDatasetAction' :: ContainerDatasetAction -> Text
image} -> Text
image) (\s :: ContainerDatasetAction
s@ContainerDatasetAction' {} Text
a -> ContainerDatasetAction
s {$sel:image:ContainerDatasetAction' :: Text
image = Text
a} :: ContainerDatasetAction)
containerDatasetAction_executionRoleArn :: Lens.Lens' ContainerDatasetAction Prelude.Text
containerDatasetAction_executionRoleArn :: (Text -> f Text)
-> ContainerDatasetAction -> f ContainerDatasetAction
containerDatasetAction_executionRoleArn = (ContainerDatasetAction -> Text)
-> (ContainerDatasetAction -> Text -> ContainerDatasetAction)
-> Lens ContainerDatasetAction ContainerDatasetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDatasetAction' {Text
executionRoleArn :: Text
$sel:executionRoleArn:ContainerDatasetAction' :: ContainerDatasetAction -> Text
executionRoleArn} -> Text
executionRoleArn) (\s :: ContainerDatasetAction
s@ContainerDatasetAction' {} Text
a -> ContainerDatasetAction
s {$sel:executionRoleArn:ContainerDatasetAction' :: Text
executionRoleArn = Text
a} :: ContainerDatasetAction)
containerDatasetAction_resourceConfiguration :: Lens.Lens' ContainerDatasetAction ResourceConfiguration
containerDatasetAction_resourceConfiguration :: (ResourceConfiguration -> f ResourceConfiguration)
-> ContainerDatasetAction -> f ContainerDatasetAction
containerDatasetAction_resourceConfiguration = (ContainerDatasetAction -> ResourceConfiguration)
-> (ContainerDatasetAction
-> ResourceConfiguration -> ContainerDatasetAction)
-> Lens
ContainerDatasetAction
ContainerDatasetAction
ResourceConfiguration
ResourceConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDatasetAction' {ResourceConfiguration
resourceConfiguration :: ResourceConfiguration
$sel:resourceConfiguration:ContainerDatasetAction' :: ContainerDatasetAction -> ResourceConfiguration
resourceConfiguration} -> ResourceConfiguration
resourceConfiguration) (\s :: ContainerDatasetAction
s@ContainerDatasetAction' {} ResourceConfiguration
a -> ContainerDatasetAction
s {$sel:resourceConfiguration:ContainerDatasetAction' :: ResourceConfiguration
resourceConfiguration = ResourceConfiguration
a} :: ContainerDatasetAction)
instance Core.FromJSON ContainerDatasetAction where
parseJSON :: Value -> Parser ContainerDatasetAction
parseJSON =
String
-> (Object -> Parser ContainerDatasetAction)
-> Value
-> Parser ContainerDatasetAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContainerDatasetAction"
( \Object
x ->
Maybe [Variable]
-> Text -> Text -> ResourceConfiguration -> ContainerDatasetAction
ContainerDatasetAction'
(Maybe [Variable]
-> Text -> Text -> ResourceConfiguration -> ContainerDatasetAction)
-> Parser (Maybe [Variable])
-> Parser
(Text -> Text -> ResourceConfiguration -> ContainerDatasetAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Variable]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"variables" Parser (Maybe (Maybe [Variable]))
-> Maybe [Variable] -> Parser (Maybe [Variable])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Variable]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Text -> Text -> ResourceConfiguration -> ContainerDatasetAction)
-> Parser Text
-> Parser (Text -> ResourceConfiguration -> ContainerDatasetAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"image")
Parser (Text -> ResourceConfiguration -> ContainerDatasetAction)
-> Parser Text
-> Parser (ResourceConfiguration -> ContainerDatasetAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"executionRoleArn")
Parser (ResourceConfiguration -> ContainerDatasetAction)
-> Parser ResourceConfiguration -> Parser ContainerDatasetAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResourceConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourceConfiguration")
)
instance Prelude.Hashable ContainerDatasetAction
instance Prelude.NFData ContainerDatasetAction
instance Core.ToJSON ContainerDatasetAction where
toJSON :: ContainerDatasetAction -> Value
toJSON ContainerDatasetAction' {Maybe [Variable]
Text
ResourceConfiguration
resourceConfiguration :: ResourceConfiguration
executionRoleArn :: Text
image :: Text
variables :: Maybe [Variable]
$sel:resourceConfiguration:ContainerDatasetAction' :: ContainerDatasetAction -> ResourceConfiguration
$sel:executionRoleArn:ContainerDatasetAction' :: ContainerDatasetAction -> Text
$sel:image:ContainerDatasetAction' :: ContainerDatasetAction -> Text
$sel:variables:ContainerDatasetAction' :: ContainerDatasetAction -> Maybe [Variable]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"variables" Text -> [Variable] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Variable] -> Pair) -> Maybe [Variable] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Variable]
variables,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"image" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
image),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"executionRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
executionRoleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"resourceConfiguration"
Text -> ResourceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ResourceConfiguration
resourceConfiguration
)
]
)