{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types.ExecuteCommandLogConfiguration
import Amazonka.ECS.Types.ExecuteCommandLogging
import qualified Amazonka.Prelude as Prelude
data ExecuteCommandConfiguration = ExecuteCommandConfiguration'
{
ExecuteCommandConfiguration -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
ExecuteCommandConfiguration -> Maybe ExecuteCommandLogConfiguration
logConfiguration :: Prelude.Maybe ExecuteCommandLogConfiguration,
ExecuteCommandConfiguration -> Maybe ExecuteCommandLogging
logging :: Prelude.Maybe ExecuteCommandLogging
}
deriving (ExecuteCommandConfiguration -> ExecuteCommandConfiguration -> Bool
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]
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
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.
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'
{ $sel:kmsKeyId:ExecuteCommandConfiguration' :: Maybe Text
kmsKeyId =
forall a. Maybe a
Prelude.Nothing,
$sel:logConfiguration:ExecuteCommandConfiguration' :: Maybe ExecuteCommandLogConfiguration
logConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:logging:ExecuteCommandConfiguration' :: Maybe ExecuteCommandLogging
logging = forall a. Maybe a
Prelude.Nothing
}
executeCommandConfiguration_kmsKeyId :: Lens.Lens' ExecuteCommandConfiguration (Prelude.Maybe Prelude.Text)
executeCommandConfiguration_kmsKeyId :: Lens' ExecuteCommandConfiguration (Maybe Text)
executeCommandConfiguration_kmsKeyId = 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_logConfiguration :: Lens.Lens' ExecuteCommandConfiguration (Prelude.Maybe ExecuteCommandLogConfiguration)
executeCommandConfiguration_logConfiguration :: Lens'
ExecuteCommandConfiguration (Maybe ExecuteCommandLogConfiguration)
executeCommandConfiguration_logConfiguration = 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_logging :: Lens.Lens' ExecuteCommandConfiguration (Prelude.Maybe ExecuteCommandLogging)
executeCommandConfiguration_logging :: Lens' ExecuteCommandConfiguration (Maybe ExecuteCommandLogging)
executeCommandConfiguration_logging = 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 Data.FromJSON ExecuteCommandConfiguration where
parseJSON :: Value -> Parser ExecuteCommandConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ExecuteCommandConfiguration"
( \Object
x ->
Maybe Text
-> Maybe ExecuteCommandLogConfiguration
-> Maybe ExecuteCommandLogging
-> ExecuteCommandConfiguration
ExecuteCommandConfiguration'
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
"kmsKeyId")
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
"logConfiguration")
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
"logging")
)
instance Prelude.Hashable ExecuteCommandConfiguration where
hashWithSalt :: Int -> ExecuteCommandConfiguration -> Int
hashWithSalt Int
_salt ExecuteCommandConfiguration' {Maybe Text
Maybe ExecuteCommandLogConfiguration
Maybe ExecuteCommandLogging
logging :: Maybe ExecuteCommandLogging
logConfiguration :: Maybe ExecuteCommandLogConfiguration
kmsKeyId :: Maybe Text
$sel:logging:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe ExecuteCommandLogging
$sel:logConfiguration:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe ExecuteCommandLogConfiguration
$sel:kmsKeyId:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExecuteCommandLogConfiguration
logConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExecuteCommandLogging
logging
instance Prelude.NFData ExecuteCommandConfiguration where
rnf :: ExecuteCommandConfiguration -> ()
rnf ExecuteCommandConfiguration' {Maybe Text
Maybe ExecuteCommandLogConfiguration
Maybe ExecuteCommandLogging
logging :: Maybe ExecuteCommandLogging
logConfiguration :: Maybe ExecuteCommandLogConfiguration
kmsKeyId :: Maybe Text
$sel:logging:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe ExecuteCommandLogging
$sel:logConfiguration:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe ExecuteCommandLogConfiguration
$sel:kmsKeyId:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExecuteCommandLogConfiguration
logConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExecuteCommandLogging
logging
instance Data.ToJSON ExecuteCommandConfiguration where
toJSON :: ExecuteCommandConfiguration -> Value
toJSON ExecuteCommandConfiguration' {Maybe Text
Maybe ExecuteCommandLogConfiguration
Maybe ExecuteCommandLogging
logging :: Maybe ExecuteCommandLogging
logConfiguration :: Maybe ExecuteCommandLogConfiguration
kmsKeyId :: Maybe Text
$sel:logging:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe ExecuteCommandLogging
$sel:logConfiguration:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe ExecuteCommandLogConfiguration
$sel:kmsKeyId:ExecuteCommandConfiguration' :: ExecuteCommandConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"kmsKeyId" 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
kmsKeyId,
(Key
"logConfiguration" 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 ExecuteCommandLogConfiguration
logConfiguration,
(Key
"logging" 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 ExecuteCommandLogging
logging
]
)