{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSMIncidents.Types.AutomationExecution where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $sel:ssmExecutionArn:AutomationExecution' :: Maybe Text
ssmExecutionArn =
        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 :: Lens' AutomationExecution (Maybe Text)
automationExecution_ssmExecutionArn = 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 Data.FromJSON AutomationExecution where
  parseJSON :: Value -> Parser AutomationExecution
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AutomationExecution"
      ( \Object
x ->
          Maybe Text -> AutomationExecution
AutomationExecution'
            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
"ssmExecutionArn")
      )

instance Prelude.Hashable AutomationExecution where
  hashWithSalt :: Int -> AutomationExecution -> Int
hashWithSalt Int
_salt AutomationExecution' {Maybe Text
ssmExecutionArn :: Maybe Text
$sel:ssmExecutionArn:AutomationExecution' :: AutomationExecution -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ssmExecutionArn

instance Prelude.NFData AutomationExecution where
  rnf :: AutomationExecution -> ()
rnf AutomationExecution' {Maybe Text
ssmExecutionArn :: Maybe Text
$sel:ssmExecutionArn:AutomationExecution' :: AutomationExecution -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ssmExecutionArn