{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.FIS.CreateExperimentTemplate
(
CreateExperimentTemplate (..),
newCreateExperimentTemplate,
createExperimentTemplate_logConfiguration,
createExperimentTemplate_tags,
createExperimentTemplate_targets,
createExperimentTemplate_clientToken,
createExperimentTemplate_description,
createExperimentTemplate_stopConditions,
createExperimentTemplate_actions,
createExperimentTemplate_roleArn,
CreateExperimentTemplateResponse (..),
newCreateExperimentTemplateResponse,
createExperimentTemplateResponse_experimentTemplate,
createExperimentTemplateResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FIS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateExperimentTemplate = CreateExperimentTemplate'
{
CreateExperimentTemplate
-> Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration :: Prelude.Maybe CreateExperimentTemplateLogConfigurationInput,
CreateExperimentTemplate -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateExperimentTemplate
-> Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets :: Prelude.Maybe (Prelude.HashMap Prelude.Text CreateExperimentTemplateTargetInput),
CreateExperimentTemplate -> Text
clientToken :: Prelude.Text,
CreateExperimentTemplate -> Text
description :: Prelude.Text,
CreateExperimentTemplate
-> [CreateExperimentTemplateStopConditionInput]
stopConditions :: [CreateExperimentTemplateStopConditionInput],
CreateExperimentTemplate
-> HashMap Text CreateExperimentTemplateActionInput
actions :: Prelude.HashMap Prelude.Text CreateExperimentTemplateActionInput,
CreateExperimentTemplate -> Text
roleArn :: Prelude.Text
}
deriving (CreateExperimentTemplate -> CreateExperimentTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateExperimentTemplate -> CreateExperimentTemplate -> Bool
$c/= :: CreateExperimentTemplate -> CreateExperimentTemplate -> Bool
== :: CreateExperimentTemplate -> CreateExperimentTemplate -> Bool
$c== :: CreateExperimentTemplate -> CreateExperimentTemplate -> Bool
Prelude.Eq, ReadPrec [CreateExperimentTemplate]
ReadPrec CreateExperimentTemplate
Int -> ReadS CreateExperimentTemplate
ReadS [CreateExperimentTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateExperimentTemplate]
$creadListPrec :: ReadPrec [CreateExperimentTemplate]
readPrec :: ReadPrec CreateExperimentTemplate
$creadPrec :: ReadPrec CreateExperimentTemplate
readList :: ReadS [CreateExperimentTemplate]
$creadList :: ReadS [CreateExperimentTemplate]
readsPrec :: Int -> ReadS CreateExperimentTemplate
$creadsPrec :: Int -> ReadS CreateExperimentTemplate
Prelude.Read, Int -> CreateExperimentTemplate -> ShowS
[CreateExperimentTemplate] -> ShowS
CreateExperimentTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateExperimentTemplate] -> ShowS
$cshowList :: [CreateExperimentTemplate] -> ShowS
show :: CreateExperimentTemplate -> String
$cshow :: CreateExperimentTemplate -> String
showsPrec :: Int -> CreateExperimentTemplate -> ShowS
$cshowsPrec :: Int -> CreateExperimentTemplate -> ShowS
Prelude.Show, forall x.
Rep CreateExperimentTemplate x -> CreateExperimentTemplate
forall x.
CreateExperimentTemplate -> Rep CreateExperimentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateExperimentTemplate x -> CreateExperimentTemplate
$cfrom :: forall x.
CreateExperimentTemplate -> Rep CreateExperimentTemplate x
Prelude.Generic)
newCreateExperimentTemplate ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateExperimentTemplate
newCreateExperimentTemplate :: Text -> Text -> Text -> CreateExperimentTemplate
newCreateExperimentTemplate
Text
pClientToken_
Text
pDescription_
Text
pRoleArn_ =
CreateExperimentTemplate'
{ $sel:logConfiguration:CreateExperimentTemplate' :: Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateExperimentTemplate' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:targets:CreateExperimentTemplate' :: Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets = forall a. Maybe a
Prelude.Nothing,
$sel:clientToken:CreateExperimentTemplate' :: Text
clientToken = Text
pClientToken_,
$sel:description:CreateExperimentTemplate' :: Text
description = Text
pDescription_,
$sel:stopConditions:CreateExperimentTemplate' :: [CreateExperimentTemplateStopConditionInput]
stopConditions = forall a. Monoid a => a
Prelude.mempty,
$sel:actions:CreateExperimentTemplate' :: HashMap Text CreateExperimentTemplateActionInput
actions = forall a. Monoid a => a
Prelude.mempty,
$sel:roleArn:CreateExperimentTemplate' :: Text
roleArn = Text
pRoleArn_
}
createExperimentTemplate_logConfiguration :: Lens.Lens' CreateExperimentTemplate (Prelude.Maybe CreateExperimentTemplateLogConfigurationInput)
createExperimentTemplate_logConfiguration :: Lens'
CreateExperimentTemplate
(Maybe CreateExperimentTemplateLogConfigurationInput)
createExperimentTemplate_logConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration :: Maybe CreateExperimentTemplateLogConfigurationInput
$sel:logConfiguration:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration} -> Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} Maybe CreateExperimentTemplateLogConfigurationInput
a -> CreateExperimentTemplate
s {$sel:logConfiguration:CreateExperimentTemplate' :: Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration = Maybe CreateExperimentTemplateLogConfigurationInput
a} :: CreateExperimentTemplate)
createExperimentTemplate_tags :: Lens.Lens' CreateExperimentTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createExperimentTemplate_tags :: Lens' CreateExperimentTemplate (Maybe (HashMap Text Text))
createExperimentTemplate_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateExperimentTemplate' :: CreateExperimentTemplate -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} Maybe (HashMap Text Text)
a -> CreateExperimentTemplate
s {$sel:tags:CreateExperimentTemplate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateExperimentTemplate) 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
createExperimentTemplate_targets :: Lens.Lens' CreateExperimentTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text CreateExperimentTemplateTargetInput))
createExperimentTemplate_targets :: Lens'
CreateExperimentTemplate
(Maybe (HashMap Text CreateExperimentTemplateTargetInput))
createExperimentTemplate_targets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets :: Maybe (HashMap Text CreateExperimentTemplateTargetInput)
$sel:targets:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets} -> Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} Maybe (HashMap Text CreateExperimentTemplateTargetInput)
a -> CreateExperimentTemplate
s {$sel:targets:CreateExperimentTemplate' :: Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets = Maybe (HashMap Text CreateExperimentTemplateTargetInput)
a} :: CreateExperimentTemplate) 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
createExperimentTemplate_clientToken :: Lens.Lens' CreateExperimentTemplate Prelude.Text
createExperimentTemplate_clientToken :: Lens' CreateExperimentTemplate Text
createExperimentTemplate_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {Text
clientToken :: Text
$sel:clientToken:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
clientToken} -> Text
clientToken) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} Text
a -> CreateExperimentTemplate
s {$sel:clientToken:CreateExperimentTemplate' :: Text
clientToken = Text
a} :: CreateExperimentTemplate)
createExperimentTemplate_description :: Lens.Lens' CreateExperimentTemplate Prelude.Text
createExperimentTemplate_description :: Lens' CreateExperimentTemplate Text
createExperimentTemplate_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {Text
description :: Text
$sel:description:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
description} -> Text
description) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} Text
a -> CreateExperimentTemplate
s {$sel:description:CreateExperimentTemplate' :: Text
description = Text
a} :: CreateExperimentTemplate)
createExperimentTemplate_stopConditions :: Lens.Lens' CreateExperimentTemplate [CreateExperimentTemplateStopConditionInput]
createExperimentTemplate_stopConditions :: Lens'
CreateExperimentTemplate
[CreateExperimentTemplateStopConditionInput]
createExperimentTemplate_stopConditions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {[CreateExperimentTemplateStopConditionInput]
stopConditions :: [CreateExperimentTemplateStopConditionInput]
$sel:stopConditions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> [CreateExperimentTemplateStopConditionInput]
stopConditions} -> [CreateExperimentTemplateStopConditionInput]
stopConditions) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} [CreateExperimentTemplateStopConditionInput]
a -> CreateExperimentTemplate
s {$sel:stopConditions:CreateExperimentTemplate' :: [CreateExperimentTemplateStopConditionInput]
stopConditions = [CreateExperimentTemplateStopConditionInput]
a} :: CreateExperimentTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createExperimentTemplate_actions :: Lens.Lens' CreateExperimentTemplate (Prelude.HashMap Prelude.Text CreateExperimentTemplateActionInput)
createExperimentTemplate_actions :: Lens'
CreateExperimentTemplate
(HashMap Text CreateExperimentTemplateActionInput)
createExperimentTemplate_actions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {HashMap Text CreateExperimentTemplateActionInput
actions :: HashMap Text CreateExperimentTemplateActionInput
$sel:actions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> HashMap Text CreateExperimentTemplateActionInput
actions} -> HashMap Text CreateExperimentTemplateActionInput
actions) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} HashMap Text CreateExperimentTemplateActionInput
a -> CreateExperimentTemplate
s {$sel:actions:CreateExperimentTemplate' :: HashMap Text CreateExperimentTemplateActionInput
actions = HashMap Text CreateExperimentTemplateActionInput
a} :: CreateExperimentTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createExperimentTemplate_roleArn :: Lens.Lens' CreateExperimentTemplate Prelude.Text
createExperimentTemplate_roleArn :: Lens' CreateExperimentTemplate Text
createExperimentTemplate_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplate' {Text
roleArn :: Text
$sel:roleArn:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
roleArn} -> Text
roleArn) (\s :: CreateExperimentTemplate
s@CreateExperimentTemplate' {} Text
a -> CreateExperimentTemplate
s {$sel:roleArn:CreateExperimentTemplate' :: Text
roleArn = Text
a} :: CreateExperimentTemplate)
instance Core.AWSRequest CreateExperimentTemplate where
type
AWSResponse CreateExperimentTemplate =
CreateExperimentTemplateResponse
request :: (Service -> Service)
-> CreateExperimentTemplate -> Request CreateExperimentTemplate
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateExperimentTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateExperimentTemplate)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ExperimentTemplate -> Int -> CreateExperimentTemplateResponse
CreateExperimentTemplateResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"experimentTemplate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateExperimentTemplate where
hashWithSalt :: Int -> CreateExperimentTemplate -> Int
hashWithSalt Int
_salt CreateExperimentTemplate' {[CreateExperimentTemplateStopConditionInput]
Maybe (HashMap Text Text)
Maybe (HashMap Text CreateExperimentTemplateTargetInput)
Maybe CreateExperimentTemplateLogConfigurationInput
Text
HashMap Text CreateExperimentTemplateActionInput
roleArn :: Text
actions :: HashMap Text CreateExperimentTemplateActionInput
stopConditions :: [CreateExperimentTemplateStopConditionInput]
description :: Text
clientToken :: Text
targets :: Maybe (HashMap Text CreateExperimentTemplateTargetInput)
tags :: Maybe (HashMap Text Text)
logConfiguration :: Maybe CreateExperimentTemplateLogConfigurationInput
$sel:roleArn:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:actions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> HashMap Text CreateExperimentTemplateActionInput
$sel:stopConditions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> [CreateExperimentTemplateStopConditionInput]
$sel:description:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:clientToken:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:targets:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe (HashMap Text CreateExperimentTemplateTargetInput)
$sel:tags:CreateExperimentTemplate' :: CreateExperimentTemplate -> Maybe (HashMap Text Text)
$sel:logConfiguration:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe CreateExperimentTemplateLogConfigurationInput
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [CreateExperimentTemplateStopConditionInput]
stopConditions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text CreateExperimentTemplateActionInput
actions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
instance Prelude.NFData CreateExperimentTemplate where
rnf :: CreateExperimentTemplate -> ()
rnf CreateExperimentTemplate' {[CreateExperimentTemplateStopConditionInput]
Maybe (HashMap Text Text)
Maybe (HashMap Text CreateExperimentTemplateTargetInput)
Maybe CreateExperimentTemplateLogConfigurationInput
Text
HashMap Text CreateExperimentTemplateActionInput
roleArn :: Text
actions :: HashMap Text CreateExperimentTemplateActionInput
stopConditions :: [CreateExperimentTemplateStopConditionInput]
description :: Text
clientToken :: Text
targets :: Maybe (HashMap Text CreateExperimentTemplateTargetInput)
tags :: Maybe (HashMap Text Text)
logConfiguration :: Maybe CreateExperimentTemplateLogConfigurationInput
$sel:roleArn:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:actions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> HashMap Text CreateExperimentTemplateActionInput
$sel:stopConditions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> [CreateExperimentTemplateStopConditionInput]
$sel:description:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:clientToken:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:targets:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe (HashMap Text CreateExperimentTemplateTargetInput)
$sel:tags:CreateExperimentTemplate' :: CreateExperimentTemplate -> Maybe (HashMap Text Text)
$sel:logConfiguration:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe CreateExperimentTemplateLogConfigurationInput
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CreateExperimentTemplateLogConfigurationInput
logConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text CreateExperimentTemplateTargetInput)
targets
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [CreateExperimentTemplateStopConditionInput]
stopConditions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text CreateExperimentTemplateActionInput
actions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
instance Data.ToHeaders CreateExperimentTemplate where
toHeaders :: CreateExperimentTemplate -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateExperimentTemplate where
toJSON :: CreateExperimentTemplate -> Value
toJSON CreateExperimentTemplate' {[CreateExperimentTemplateStopConditionInput]
Maybe (HashMap Text Text)
Maybe (HashMap Text CreateExperimentTemplateTargetInput)
Maybe CreateExperimentTemplateLogConfigurationInput
Text
HashMap Text CreateExperimentTemplateActionInput
roleArn :: Text
actions :: HashMap Text CreateExperimentTemplateActionInput
stopConditions :: [CreateExperimentTemplateStopConditionInput]
description :: Text
clientToken :: Text
targets :: Maybe (HashMap Text CreateExperimentTemplateTargetInput)
tags :: Maybe (HashMap Text Text)
logConfiguration :: Maybe CreateExperimentTemplateLogConfigurationInput
$sel:roleArn:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:actions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> HashMap Text CreateExperimentTemplateActionInput
$sel:stopConditions:CreateExperimentTemplate' :: CreateExperimentTemplate
-> [CreateExperimentTemplateStopConditionInput]
$sel:description:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:clientToken:CreateExperimentTemplate' :: CreateExperimentTemplate -> Text
$sel:targets:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe (HashMap Text CreateExperimentTemplateTargetInput)
$sel:tags:CreateExperimentTemplate' :: CreateExperimentTemplate -> Maybe (HashMap Text Text)
$sel:logConfiguration:CreateExperimentTemplate' :: CreateExperimentTemplate
-> Maybe CreateExperimentTemplateLogConfigurationInput
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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 CreateExperimentTemplateLogConfigurationInput
logConfiguration,
(Key
"tags" 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)
tags,
(Key
"targets" 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 CreateExperimentTemplateTargetInput)
targets,
forall a. a -> Maybe a
Prelude.Just (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientToken),
forall a. a -> Maybe a
Prelude.Just (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
description),
forall a. a -> Maybe a
Prelude.Just
(Key
"stopConditions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [CreateExperimentTemplateStopConditionInput]
stopConditions),
forall a. a -> Maybe a
Prelude.Just (Key
"actions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text CreateExperimentTemplateActionInput
actions),
forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
]
)
instance Data.ToPath CreateExperimentTemplate where
toPath :: CreateExperimentTemplate -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/experimentTemplates"
instance Data.ToQuery CreateExperimentTemplate where
toQuery :: CreateExperimentTemplate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateExperimentTemplateResponse = CreateExperimentTemplateResponse'
{
CreateExperimentTemplateResponse -> Maybe ExperimentTemplate
experimentTemplate :: Prelude.Maybe ExperimentTemplate,
CreateExperimentTemplateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateExperimentTemplateResponse
-> CreateExperimentTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateExperimentTemplateResponse
-> CreateExperimentTemplateResponse -> Bool
$c/= :: CreateExperimentTemplateResponse
-> CreateExperimentTemplateResponse -> Bool
== :: CreateExperimentTemplateResponse
-> CreateExperimentTemplateResponse -> Bool
$c== :: CreateExperimentTemplateResponse
-> CreateExperimentTemplateResponse -> Bool
Prelude.Eq, ReadPrec [CreateExperimentTemplateResponse]
ReadPrec CreateExperimentTemplateResponse
Int -> ReadS CreateExperimentTemplateResponse
ReadS [CreateExperimentTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateExperimentTemplateResponse]
$creadListPrec :: ReadPrec [CreateExperimentTemplateResponse]
readPrec :: ReadPrec CreateExperimentTemplateResponse
$creadPrec :: ReadPrec CreateExperimentTemplateResponse
readList :: ReadS [CreateExperimentTemplateResponse]
$creadList :: ReadS [CreateExperimentTemplateResponse]
readsPrec :: Int -> ReadS CreateExperimentTemplateResponse
$creadsPrec :: Int -> ReadS CreateExperimentTemplateResponse
Prelude.Read, Int -> CreateExperimentTemplateResponse -> ShowS
[CreateExperimentTemplateResponse] -> ShowS
CreateExperimentTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateExperimentTemplateResponse] -> ShowS
$cshowList :: [CreateExperimentTemplateResponse] -> ShowS
show :: CreateExperimentTemplateResponse -> String
$cshow :: CreateExperimentTemplateResponse -> String
showsPrec :: Int -> CreateExperimentTemplateResponse -> ShowS
$cshowsPrec :: Int -> CreateExperimentTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep CreateExperimentTemplateResponse x
-> CreateExperimentTemplateResponse
forall x.
CreateExperimentTemplateResponse
-> Rep CreateExperimentTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateExperimentTemplateResponse x
-> CreateExperimentTemplateResponse
$cfrom :: forall x.
CreateExperimentTemplateResponse
-> Rep CreateExperimentTemplateResponse x
Prelude.Generic)
newCreateExperimentTemplateResponse ::
Prelude.Int ->
CreateExperimentTemplateResponse
newCreateExperimentTemplateResponse :: Int -> CreateExperimentTemplateResponse
newCreateExperimentTemplateResponse Int
pHttpStatus_ =
CreateExperimentTemplateResponse'
{ $sel:experimentTemplate:CreateExperimentTemplateResponse' :: Maybe ExperimentTemplate
experimentTemplate =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateExperimentTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createExperimentTemplateResponse_experimentTemplate :: Lens.Lens' CreateExperimentTemplateResponse (Prelude.Maybe ExperimentTemplate)
createExperimentTemplateResponse_experimentTemplate :: Lens' CreateExperimentTemplateResponse (Maybe ExperimentTemplate)
createExperimentTemplateResponse_experimentTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplateResponse' {Maybe ExperimentTemplate
experimentTemplate :: Maybe ExperimentTemplate
$sel:experimentTemplate:CreateExperimentTemplateResponse' :: CreateExperimentTemplateResponse -> Maybe ExperimentTemplate
experimentTemplate} -> Maybe ExperimentTemplate
experimentTemplate) (\s :: CreateExperimentTemplateResponse
s@CreateExperimentTemplateResponse' {} Maybe ExperimentTemplate
a -> CreateExperimentTemplateResponse
s {$sel:experimentTemplate:CreateExperimentTemplateResponse' :: Maybe ExperimentTemplate
experimentTemplate = Maybe ExperimentTemplate
a} :: CreateExperimentTemplateResponse)
createExperimentTemplateResponse_httpStatus :: Lens.Lens' CreateExperimentTemplateResponse Prelude.Int
createExperimentTemplateResponse_httpStatus :: Lens' CreateExperimentTemplateResponse Int
createExperimentTemplateResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExperimentTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateExperimentTemplateResponse' :: CreateExperimentTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateExperimentTemplateResponse
s@CreateExperimentTemplateResponse' {} Int
a -> CreateExperimentTemplateResponse
s {$sel:httpStatus:CreateExperimentTemplateResponse' :: Int
httpStatus = Int
a} :: CreateExperimentTemplateResponse)
instance
Prelude.NFData
CreateExperimentTemplateResponse
where
rnf :: CreateExperimentTemplateResponse -> ()
rnf CreateExperimentTemplateResponse' {Int
Maybe ExperimentTemplate
httpStatus :: Int
experimentTemplate :: Maybe ExperimentTemplate
$sel:httpStatus:CreateExperimentTemplateResponse' :: CreateExperimentTemplateResponse -> Int
$sel:experimentTemplate:CreateExperimentTemplateResponse' :: CreateExperimentTemplateResponse -> Maybe ExperimentTemplate
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ExperimentTemplate
experimentTemplate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus