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

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

-- |
-- Module      : Amazonka.SSMIncidents.Types.AutomationExecution
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSMIncidents.Types.AutomationExecution where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The Systems Manager automation document process to start as the runbook
-- at the beginning of the incident.
--
-- /See:/ 'newAutomationExecution' smart constructor.
data AutomationExecution = AutomationExecution'
  { -- | The Amazon Resource Name (ARN) of the automation process.
    AutomationExecution -> Maybe Text
ssmExecutionArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AutomationExecution -> AutomationExecution -> Bool
(AutomationExecution -> AutomationExecution -> Bool)
-> (AutomationExecution -> AutomationExecution -> Bool)
-> Eq AutomationExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutomationExecution -> AutomationExecution -> Bool
$c/= :: AutomationExecution -> AutomationExecution -> Bool
== :: AutomationExecution -> AutomationExecution -> Bool
$c== :: AutomationExecution -> AutomationExecution -> Bool
Prelude.Eq, ReadPrec [AutomationExecution]
ReadPrec AutomationExecution
Int -> ReadS AutomationExecution
ReadS [AutomationExecution]
(Int -> ReadS AutomationExecution)
-> ReadS [AutomationExecution]
-> ReadPrec AutomationExecution
-> ReadPrec [AutomationExecution]
-> Read AutomationExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutomationExecution]
$creadListPrec :: ReadPrec [AutomationExecution]
readPrec :: ReadPrec AutomationExecution
$creadPrec :: ReadPrec AutomationExecution
readList :: ReadS [AutomationExecution]
$creadList :: ReadS [AutomationExecution]
readsPrec :: Int -> ReadS AutomationExecution
$creadsPrec :: Int -> ReadS AutomationExecution
Prelude.Read, Int -> AutomationExecution -> ShowS
[AutomationExecution] -> ShowS
AutomationExecution -> String
(Int -> AutomationExecution -> ShowS)
-> (AutomationExecution -> String)
-> ([AutomationExecution] -> ShowS)
-> Show AutomationExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutomationExecution] -> ShowS
$cshowList :: [AutomationExecution] -> ShowS
show :: AutomationExecution -> String
$cshow :: AutomationExecution -> String
showsPrec :: Int -> AutomationExecution -> ShowS
$cshowsPrec :: Int -> AutomationExecution -> ShowS
Prelude.Show, (forall x. AutomationExecution -> Rep AutomationExecution x)
-> (forall x. Rep AutomationExecution x -> AutomationExecution)
-> Generic AutomationExecution
forall x. Rep AutomationExecution x -> AutomationExecution
forall x. AutomationExecution -> Rep AutomationExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutomationExecution x -> AutomationExecution
$cfrom :: forall x. AutomationExecution -> Rep AutomationExecution x
Prelude.Generic)

-- |
-- Create a value of 'AutomationExecution' 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:
--
-- 'ssmExecutionArn', 'automationExecution_ssmExecutionArn' - The Amazon Resource Name (ARN) of the automation process.
newAutomationExecution ::
  AutomationExecution
newAutomationExecution :: AutomationExecution
newAutomationExecution =
  AutomationExecution' :: Maybe Text -> AutomationExecution
AutomationExecution'
    { $sel:ssmExecutionArn:AutomationExecution' :: Maybe Text
ssmExecutionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the automation process.
automationExecution_ssmExecutionArn :: Lens.Lens' AutomationExecution (Prelude.Maybe Prelude.Text)
automationExecution_ssmExecutionArn :: (Maybe Text -> f (Maybe Text))
-> AutomationExecution -> f AutomationExecution
automationExecution_ssmExecutionArn = (AutomationExecution -> Maybe Text)
-> (AutomationExecution -> Maybe Text -> AutomationExecution)
-> Lens
     AutomationExecution AutomationExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomationExecution' {Maybe Text
ssmExecutionArn :: Maybe Text
$sel:ssmExecutionArn:AutomationExecution' :: AutomationExecution -> Maybe Text
ssmExecutionArn} -> Maybe Text
ssmExecutionArn) (\s :: AutomationExecution
s@AutomationExecution' {} Maybe Text
a -> AutomationExecution
s {$sel:ssmExecutionArn:AutomationExecution' :: Maybe Text
ssmExecutionArn = Maybe Text
a} :: AutomationExecution)

instance Core.FromJSON AutomationExecution where
  parseJSON :: Value -> Parser AutomationExecution
parseJSON =
    String
-> (Object -> Parser AutomationExecution)
-> Value
-> Parser AutomationExecution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutomationExecution"
      ( \Object
x ->
          Maybe Text -> AutomationExecution
AutomationExecution'
            (Maybe Text -> AutomationExecution)
-> Parser (Maybe Text) -> Parser AutomationExecution
forall (f :: * -> *) a b. Functor 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
"ssmExecutionArn")
      )

instance Prelude.Hashable AutomationExecution

instance Prelude.NFData AutomationExecution