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