{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.FIS.UpdateExperimentTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the specified experiment template.
module Amazonka.FIS.UpdateExperimentTemplate
  ( -- * Creating a Request
    UpdateExperimentTemplate (..),
    newUpdateExperimentTemplate,

    -- * Request Lenses
    updateExperimentTemplate_actions,
    updateExperimentTemplate_description,
    updateExperimentTemplate_logConfiguration,
    updateExperimentTemplate_roleArn,
    updateExperimentTemplate_stopConditions,
    updateExperimentTemplate_targets,
    updateExperimentTemplate_id,

    -- * Destructuring the Response
    UpdateExperimentTemplateResponse (..),
    newUpdateExperimentTemplateResponse,

    -- * Response Lenses
    updateExperimentTemplateResponse_experimentTemplate,
    updateExperimentTemplateResponse_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

-- | /See:/ 'newUpdateExperimentTemplate' smart constructor.
data UpdateExperimentTemplate = UpdateExperimentTemplate'
  { -- | The actions for the experiment.
    UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions :: Prelude.Maybe (Prelude.HashMap Prelude.Text UpdateExperimentTemplateActionInputItem),
    -- | A description for the template.
    UpdateExperimentTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The configuration for experiment logging.
    UpdateExperimentTemplate
-> Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration :: Prelude.Maybe UpdateExperimentTemplateLogConfigurationInput,
    -- | The Amazon Resource Name (ARN) of an IAM role that grants the FIS
    -- service permission to perform service actions on your behalf.
    UpdateExperimentTemplate -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The stop conditions for the experiment.
    UpdateExperimentTemplate
-> Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions :: Prelude.Maybe [UpdateExperimentTemplateStopConditionInput],
    -- | The targets for the experiment.
    UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets :: Prelude.Maybe (Prelude.HashMap Prelude.Text UpdateExperimentTemplateTargetInput),
    -- | The ID of the experiment template.
    UpdateExperimentTemplate -> Text
id :: Prelude.Text
  }
  deriving (UpdateExperimentTemplate -> UpdateExperimentTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateExperimentTemplate -> UpdateExperimentTemplate -> Bool
$c/= :: UpdateExperimentTemplate -> UpdateExperimentTemplate -> Bool
== :: UpdateExperimentTemplate -> UpdateExperimentTemplate -> Bool
$c== :: UpdateExperimentTemplate -> UpdateExperimentTemplate -> Bool
Prelude.Eq, ReadPrec [UpdateExperimentTemplate]
ReadPrec UpdateExperimentTemplate
Int -> ReadS UpdateExperimentTemplate
ReadS [UpdateExperimentTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateExperimentTemplate]
$creadListPrec :: ReadPrec [UpdateExperimentTemplate]
readPrec :: ReadPrec UpdateExperimentTemplate
$creadPrec :: ReadPrec UpdateExperimentTemplate
readList :: ReadS [UpdateExperimentTemplate]
$creadList :: ReadS [UpdateExperimentTemplate]
readsPrec :: Int -> ReadS UpdateExperimentTemplate
$creadsPrec :: Int -> ReadS UpdateExperimentTemplate
Prelude.Read, Int -> UpdateExperimentTemplate -> ShowS
[UpdateExperimentTemplate] -> ShowS
UpdateExperimentTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateExperimentTemplate] -> ShowS
$cshowList :: [UpdateExperimentTemplate] -> ShowS
show :: UpdateExperimentTemplate -> String
$cshow :: UpdateExperimentTemplate -> String
showsPrec :: Int -> UpdateExperimentTemplate -> ShowS
$cshowsPrec :: Int -> UpdateExperimentTemplate -> ShowS
Prelude.Show, forall x.
Rep UpdateExperimentTemplate x -> UpdateExperimentTemplate
forall x.
UpdateExperimentTemplate -> Rep UpdateExperimentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateExperimentTemplate x -> UpdateExperimentTemplate
$cfrom :: forall x.
UpdateExperimentTemplate -> Rep UpdateExperimentTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UpdateExperimentTemplate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'actions', 'updateExperimentTemplate_actions' - The actions for the experiment.
--
-- 'description', 'updateExperimentTemplate_description' - A description for the template.
--
-- 'logConfiguration', 'updateExperimentTemplate_logConfiguration' - The configuration for experiment logging.
--
-- 'roleArn', 'updateExperimentTemplate_roleArn' - The Amazon Resource Name (ARN) of an IAM role that grants the FIS
-- service permission to perform service actions on your behalf.
--
-- 'stopConditions', 'updateExperimentTemplate_stopConditions' - The stop conditions for the experiment.
--
-- 'targets', 'updateExperimentTemplate_targets' - The targets for the experiment.
--
-- 'id', 'updateExperimentTemplate_id' - The ID of the experiment template.
newUpdateExperimentTemplate ::
  -- | 'id'
  Prelude.Text ->
  UpdateExperimentTemplate
newUpdateExperimentTemplate :: Text -> UpdateExperimentTemplate
newUpdateExperimentTemplate Text
pId_ =
  UpdateExperimentTemplate'
    { $sel:actions:UpdateExperimentTemplate' :: Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateExperimentTemplate' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:logConfiguration:UpdateExperimentTemplate' :: Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:UpdateExperimentTemplate' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:stopConditions:UpdateExperimentTemplate' :: Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions = forall a. Maybe a
Prelude.Nothing,
      $sel:targets:UpdateExperimentTemplate' :: Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets = forall a. Maybe a
Prelude.Nothing,
      $sel:id:UpdateExperimentTemplate' :: Text
id = Text
pId_
    }

-- | The actions for the experiment.
updateExperimentTemplate_actions :: Lens.Lens' UpdateExperimentTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text UpdateExperimentTemplateActionInputItem))
updateExperimentTemplate_actions :: Lens'
  UpdateExperimentTemplate
  (Maybe (HashMap Text UpdateExperimentTemplateActionInputItem))
updateExperimentTemplate_actions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplate' {Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions :: Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
$sel:actions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions} -> Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions) (\s :: UpdateExperimentTemplate
s@UpdateExperimentTemplate' {} Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
a -> UpdateExperimentTemplate
s {$sel:actions:UpdateExperimentTemplate' :: Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions = Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
a} :: UpdateExperimentTemplate) 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

-- | A description for the template.
updateExperimentTemplate_description :: Lens.Lens' UpdateExperimentTemplate (Prelude.Maybe Prelude.Text)
updateExperimentTemplate_description :: Lens' UpdateExperimentTemplate (Maybe Text)
updateExperimentTemplate_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplate' {Maybe Text
description :: Maybe Text
$sel:description:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateExperimentTemplate
s@UpdateExperimentTemplate' {} Maybe Text
a -> UpdateExperimentTemplate
s {$sel:description:UpdateExperimentTemplate' :: Maybe Text
description = Maybe Text
a} :: UpdateExperimentTemplate)

-- | The configuration for experiment logging.
updateExperimentTemplate_logConfiguration :: Lens.Lens' UpdateExperimentTemplate (Prelude.Maybe UpdateExperimentTemplateLogConfigurationInput)
updateExperimentTemplate_logConfiguration :: Lens'
  UpdateExperimentTemplate
  (Maybe UpdateExperimentTemplateLogConfigurationInput)
updateExperimentTemplate_logConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplate' {Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration :: Maybe UpdateExperimentTemplateLogConfigurationInput
$sel:logConfiguration:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration} -> Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration) (\s :: UpdateExperimentTemplate
s@UpdateExperimentTemplate' {} Maybe UpdateExperimentTemplateLogConfigurationInput
a -> UpdateExperimentTemplate
s {$sel:logConfiguration:UpdateExperimentTemplate' :: Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration = Maybe UpdateExperimentTemplateLogConfigurationInput
a} :: UpdateExperimentTemplate)

-- | The Amazon Resource Name (ARN) of an IAM role that grants the FIS
-- service permission to perform service actions on your behalf.
updateExperimentTemplate_roleArn :: Lens.Lens' UpdateExperimentTemplate (Prelude.Maybe Prelude.Text)
updateExperimentTemplate_roleArn :: Lens' UpdateExperimentTemplate (Maybe Text)
updateExperimentTemplate_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplate' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: UpdateExperimentTemplate
s@UpdateExperimentTemplate' {} Maybe Text
a -> UpdateExperimentTemplate
s {$sel:roleArn:UpdateExperimentTemplate' :: Maybe Text
roleArn = Maybe Text
a} :: UpdateExperimentTemplate)

-- | The stop conditions for the experiment.
updateExperimentTemplate_stopConditions :: Lens.Lens' UpdateExperimentTemplate (Prelude.Maybe [UpdateExperimentTemplateStopConditionInput])
updateExperimentTemplate_stopConditions :: Lens'
  UpdateExperimentTemplate
  (Maybe [UpdateExperimentTemplateStopConditionInput])
updateExperimentTemplate_stopConditions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplate' {Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions :: Maybe [UpdateExperimentTemplateStopConditionInput]
$sel:stopConditions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions} -> Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions) (\s :: UpdateExperimentTemplate
s@UpdateExperimentTemplate' {} Maybe [UpdateExperimentTemplateStopConditionInput]
a -> UpdateExperimentTemplate
s {$sel:stopConditions:UpdateExperimentTemplate' :: Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions = Maybe [UpdateExperimentTemplateStopConditionInput]
a} :: UpdateExperimentTemplate) 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

-- | The targets for the experiment.
updateExperimentTemplate_targets :: Lens.Lens' UpdateExperimentTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text UpdateExperimentTemplateTargetInput))
updateExperimentTemplate_targets :: Lens'
  UpdateExperimentTemplate
  (Maybe (HashMap Text UpdateExperimentTemplateTargetInput))
updateExperimentTemplate_targets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplate' {Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets :: Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
$sel:targets:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets} -> Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets) (\s :: UpdateExperimentTemplate
s@UpdateExperimentTemplate' {} Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
a -> UpdateExperimentTemplate
s {$sel:targets:UpdateExperimentTemplate' :: Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets = Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
a} :: UpdateExperimentTemplate) 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

-- | The ID of the experiment template.
updateExperimentTemplate_id :: Lens.Lens' UpdateExperimentTemplate Prelude.Text
updateExperimentTemplate_id :: Lens' UpdateExperimentTemplate Text
updateExperimentTemplate_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplate' {Text
id :: Text
$sel:id:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Text
id} -> Text
id) (\s :: UpdateExperimentTemplate
s@UpdateExperimentTemplate' {} Text
a -> UpdateExperimentTemplate
s {$sel:id:UpdateExperimentTemplate' :: Text
id = Text
a} :: UpdateExperimentTemplate)

instance Core.AWSRequest UpdateExperimentTemplate where
  type
    AWSResponse UpdateExperimentTemplate =
      UpdateExperimentTemplateResponse
  request :: (Service -> Service)
-> UpdateExperimentTemplate -> Request UpdateExperimentTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateExperimentTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateExperimentTemplate)))
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 -> UpdateExperimentTemplateResponse
UpdateExperimentTemplateResponse'
            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 UpdateExperimentTemplate where
  hashWithSalt :: Int -> UpdateExperimentTemplate -> Int
hashWithSalt Int
_salt UpdateExperimentTemplate' {Maybe [UpdateExperimentTemplateStopConditionInput]
Maybe Text
Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
Maybe UpdateExperimentTemplateLogConfigurationInput
Text
id :: Text
targets :: Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
stopConditions :: Maybe [UpdateExperimentTemplateStopConditionInput]
roleArn :: Maybe Text
logConfiguration :: Maybe UpdateExperimentTemplateLogConfigurationInput
description :: Maybe Text
actions :: Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
$sel:id:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Text
$sel:targets:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
$sel:stopConditions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe [UpdateExperimentTemplateStopConditionInput]
$sel:roleArn:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:logConfiguration:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe UpdateExperimentTemplateLogConfigurationInput
$sel:description:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:actions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

instance Prelude.NFData UpdateExperimentTemplate where
  rnf :: UpdateExperimentTemplate -> ()
rnf UpdateExperimentTemplate' {Maybe [UpdateExperimentTemplateStopConditionInput]
Maybe Text
Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
Maybe UpdateExperimentTemplateLogConfigurationInput
Text
id :: Text
targets :: Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
stopConditions :: Maybe [UpdateExperimentTemplateStopConditionInput]
roleArn :: Maybe Text
logConfiguration :: Maybe UpdateExperimentTemplateLogConfigurationInput
description :: Maybe Text
actions :: Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
$sel:id:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Text
$sel:targets:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
$sel:stopConditions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe [UpdateExperimentTemplateStopConditionInput]
$sel:roleArn:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:logConfiguration:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe UpdateExperimentTemplateLogConfigurationInput
$sel:description:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:actions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
actions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UpdateExperimentTemplateLogConfigurationInput
logConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [UpdateExperimentTemplateStopConditionInput]
stopConditions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
targets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id

instance Data.ToHeaders UpdateExperimentTemplate where
  toHeaders :: UpdateExperimentTemplate -> 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 UpdateExperimentTemplate where
  toJSON :: UpdateExperimentTemplate -> Value
toJSON UpdateExperimentTemplate' {Maybe [UpdateExperimentTemplateStopConditionInput]
Maybe Text
Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
Maybe UpdateExperimentTemplateLogConfigurationInput
Text
id :: Text
targets :: Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
stopConditions :: Maybe [UpdateExperimentTemplateStopConditionInput]
roleArn :: Maybe Text
logConfiguration :: Maybe UpdateExperimentTemplateLogConfigurationInput
description :: Maybe Text
actions :: Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
$sel:id:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Text
$sel:targets:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
$sel:stopConditions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe [UpdateExperimentTemplateStopConditionInput]
$sel:roleArn:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:logConfiguration:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe UpdateExperimentTemplateLogConfigurationInput
$sel:description:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:actions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"actions" 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 UpdateExperimentTemplateActionInputItem)
actions,
            (Key
"description" 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
description,
            (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 UpdateExperimentTemplateLogConfigurationInput
logConfiguration,
            (Key
"roleArn" 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
roleArn,
            (Key
"stopConditions" 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 [UpdateExperimentTemplateStopConditionInput]
stopConditions,
            (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 UpdateExperimentTemplateTargetInput)
targets
          ]
      )

instance Data.ToPath UpdateExperimentTemplate where
  toPath :: UpdateExperimentTemplate -> ByteString
toPath UpdateExperimentTemplate' {Maybe [UpdateExperimentTemplateStopConditionInput]
Maybe Text
Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
Maybe UpdateExperimentTemplateLogConfigurationInput
Text
id :: Text
targets :: Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
stopConditions :: Maybe [UpdateExperimentTemplateStopConditionInput]
roleArn :: Maybe Text
logConfiguration :: Maybe UpdateExperimentTemplateLogConfigurationInput
description :: Maybe Text
actions :: Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
$sel:id:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Text
$sel:targets:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateTargetInput)
$sel:stopConditions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe [UpdateExperimentTemplateStopConditionInput]
$sel:roleArn:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:logConfiguration:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe UpdateExperimentTemplateLogConfigurationInput
$sel:description:UpdateExperimentTemplate' :: UpdateExperimentTemplate -> Maybe Text
$sel:actions:UpdateExperimentTemplate' :: UpdateExperimentTemplate
-> Maybe (HashMap Text UpdateExperimentTemplateActionInputItem)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/experimentTemplates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]

instance Data.ToQuery UpdateExperimentTemplate where
  toQuery :: UpdateExperimentTemplate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateExperimentTemplateResponse' smart constructor.
data UpdateExperimentTemplateResponse = UpdateExperimentTemplateResponse'
  { -- | Information about the experiment template.
    UpdateExperimentTemplateResponse -> Maybe ExperimentTemplate
experimentTemplate :: Prelude.Maybe ExperimentTemplate,
    -- | The response's http status code.
    UpdateExperimentTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateExperimentTemplateResponse
-> UpdateExperimentTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateExperimentTemplateResponse
-> UpdateExperimentTemplateResponse -> Bool
$c/= :: UpdateExperimentTemplateResponse
-> UpdateExperimentTemplateResponse -> Bool
== :: UpdateExperimentTemplateResponse
-> UpdateExperimentTemplateResponse -> Bool
$c== :: UpdateExperimentTemplateResponse
-> UpdateExperimentTemplateResponse -> Bool
Prelude.Eq, ReadPrec [UpdateExperimentTemplateResponse]
ReadPrec UpdateExperimentTemplateResponse
Int -> ReadS UpdateExperimentTemplateResponse
ReadS [UpdateExperimentTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateExperimentTemplateResponse]
$creadListPrec :: ReadPrec [UpdateExperimentTemplateResponse]
readPrec :: ReadPrec UpdateExperimentTemplateResponse
$creadPrec :: ReadPrec UpdateExperimentTemplateResponse
readList :: ReadS [UpdateExperimentTemplateResponse]
$creadList :: ReadS [UpdateExperimentTemplateResponse]
readsPrec :: Int -> ReadS UpdateExperimentTemplateResponse
$creadsPrec :: Int -> ReadS UpdateExperimentTemplateResponse
Prelude.Read, Int -> UpdateExperimentTemplateResponse -> ShowS
[UpdateExperimentTemplateResponse] -> ShowS
UpdateExperimentTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateExperimentTemplateResponse] -> ShowS
$cshowList :: [UpdateExperimentTemplateResponse] -> ShowS
show :: UpdateExperimentTemplateResponse -> String
$cshow :: UpdateExperimentTemplateResponse -> String
showsPrec :: Int -> UpdateExperimentTemplateResponse -> ShowS
$cshowsPrec :: Int -> UpdateExperimentTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateExperimentTemplateResponse x
-> UpdateExperimentTemplateResponse
forall x.
UpdateExperimentTemplateResponse
-> Rep UpdateExperimentTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateExperimentTemplateResponse x
-> UpdateExperimentTemplateResponse
$cfrom :: forall x.
UpdateExperimentTemplateResponse
-> Rep UpdateExperimentTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateExperimentTemplateResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'experimentTemplate', 'updateExperimentTemplateResponse_experimentTemplate' - Information about the experiment template.
--
-- 'httpStatus', 'updateExperimentTemplateResponse_httpStatus' - The response's http status code.
newUpdateExperimentTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateExperimentTemplateResponse
newUpdateExperimentTemplateResponse :: Int -> UpdateExperimentTemplateResponse
newUpdateExperimentTemplateResponse Int
pHttpStatus_ =
  UpdateExperimentTemplateResponse'
    { $sel:experimentTemplate:UpdateExperimentTemplateResponse' :: Maybe ExperimentTemplate
experimentTemplate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateExperimentTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the experiment template.
updateExperimentTemplateResponse_experimentTemplate :: Lens.Lens' UpdateExperimentTemplateResponse (Prelude.Maybe ExperimentTemplate)
updateExperimentTemplateResponse_experimentTemplate :: Lens' UpdateExperimentTemplateResponse (Maybe ExperimentTemplate)
updateExperimentTemplateResponse_experimentTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplateResponse' {Maybe ExperimentTemplate
experimentTemplate :: Maybe ExperimentTemplate
$sel:experimentTemplate:UpdateExperimentTemplateResponse' :: UpdateExperimentTemplateResponse -> Maybe ExperimentTemplate
experimentTemplate} -> Maybe ExperimentTemplate
experimentTemplate) (\s :: UpdateExperimentTemplateResponse
s@UpdateExperimentTemplateResponse' {} Maybe ExperimentTemplate
a -> UpdateExperimentTemplateResponse
s {$sel:experimentTemplate:UpdateExperimentTemplateResponse' :: Maybe ExperimentTemplate
experimentTemplate = Maybe ExperimentTemplate
a} :: UpdateExperimentTemplateResponse)

-- | The response's http status code.
updateExperimentTemplateResponse_httpStatus :: Lens.Lens' UpdateExperimentTemplateResponse Prelude.Int
updateExperimentTemplateResponse_httpStatus :: Lens' UpdateExperimentTemplateResponse Int
updateExperimentTemplateResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateExperimentTemplateResponse' :: UpdateExperimentTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateExperimentTemplateResponse
s@UpdateExperimentTemplateResponse' {} Int
a -> UpdateExperimentTemplateResponse
s {$sel:httpStatus:UpdateExperimentTemplateResponse' :: Int
httpStatus = Int
a} :: UpdateExperimentTemplateResponse)

instance
  Prelude.NFData
    UpdateExperimentTemplateResponse
  where
  rnf :: UpdateExperimentTemplateResponse -> ()
rnf UpdateExperimentTemplateResponse' {Int
Maybe ExperimentTemplate
httpStatus :: Int
experimentTemplate :: Maybe ExperimentTemplate
$sel:httpStatus:UpdateExperimentTemplateResponse' :: UpdateExperimentTemplateResponse -> Int
$sel:experimentTemplate:UpdateExperimentTemplateResponse' :: UpdateExperimentTemplateResponse -> 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