{-# 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.CodePipeline.Types.ActionExecutionResult
-- 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.CodePipeline.Types.ActionExecutionResult 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

-- | Execution result information, such as the external execution ID.
--
-- /See:/ 'newActionExecutionResult' smart constructor.
data ActionExecutionResult = ActionExecutionResult'
  { -- | The action provider\'s external ID for the action execution.
    ActionExecutionResult -> Maybe Text
externalExecutionId :: Prelude.Maybe Prelude.Text,
    -- | The action provider\'s summary for the action execution.
    ActionExecutionResult -> Maybe Text
externalExecutionSummary :: Prelude.Maybe Prelude.Text,
    -- | The deepest external link to the external resource (for example, a
    -- repository URL or deployment endpoint) that is used when running the
    -- action.
    ActionExecutionResult -> Maybe Text
externalExecutionUrl :: Prelude.Maybe Prelude.Text
  }
  deriving (ActionExecutionResult -> ActionExecutionResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionExecutionResult -> ActionExecutionResult -> Bool
$c/= :: ActionExecutionResult -> ActionExecutionResult -> Bool
== :: ActionExecutionResult -> ActionExecutionResult -> Bool
$c== :: ActionExecutionResult -> ActionExecutionResult -> Bool
Prelude.Eq, ReadPrec [ActionExecutionResult]
ReadPrec ActionExecutionResult
Int -> ReadS ActionExecutionResult
ReadS [ActionExecutionResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionExecutionResult]
$creadListPrec :: ReadPrec [ActionExecutionResult]
readPrec :: ReadPrec ActionExecutionResult
$creadPrec :: ReadPrec ActionExecutionResult
readList :: ReadS [ActionExecutionResult]
$creadList :: ReadS [ActionExecutionResult]
readsPrec :: Int -> ReadS ActionExecutionResult
$creadsPrec :: Int -> ReadS ActionExecutionResult
Prelude.Read, Int -> ActionExecutionResult -> ShowS
[ActionExecutionResult] -> ShowS
ActionExecutionResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionExecutionResult] -> ShowS
$cshowList :: [ActionExecutionResult] -> ShowS
show :: ActionExecutionResult -> String
$cshow :: ActionExecutionResult -> String
showsPrec :: Int -> ActionExecutionResult -> ShowS
$cshowsPrec :: Int -> ActionExecutionResult -> ShowS
Prelude.Show, forall x. Rep ActionExecutionResult x -> ActionExecutionResult
forall x. ActionExecutionResult -> Rep ActionExecutionResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionExecutionResult x -> ActionExecutionResult
$cfrom :: forall x. ActionExecutionResult -> Rep ActionExecutionResult x
Prelude.Generic)

-- |
-- Create a value of 'ActionExecutionResult' 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:
--
-- 'externalExecutionId', 'actionExecutionResult_externalExecutionId' - The action provider\'s external ID for the action execution.
--
-- 'externalExecutionSummary', 'actionExecutionResult_externalExecutionSummary' - The action provider\'s summary for the action execution.
--
-- 'externalExecutionUrl', 'actionExecutionResult_externalExecutionUrl' - The deepest external link to the external resource (for example, a
-- repository URL or deployment endpoint) that is used when running the
-- action.
newActionExecutionResult ::
  ActionExecutionResult
newActionExecutionResult :: ActionExecutionResult
newActionExecutionResult =
  ActionExecutionResult'
    { $sel:externalExecutionId:ActionExecutionResult' :: Maybe Text
externalExecutionId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:externalExecutionSummary:ActionExecutionResult' :: Maybe Text
externalExecutionSummary = forall a. Maybe a
Prelude.Nothing,
      $sel:externalExecutionUrl:ActionExecutionResult' :: Maybe Text
externalExecutionUrl = forall a. Maybe a
Prelude.Nothing
    }

-- | The action provider\'s external ID for the action execution.
actionExecutionResult_externalExecutionId :: Lens.Lens' ActionExecutionResult (Prelude.Maybe Prelude.Text)
actionExecutionResult_externalExecutionId :: Lens' ActionExecutionResult (Maybe Text)
actionExecutionResult_externalExecutionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionResult' {Maybe Text
externalExecutionId :: Maybe Text
$sel:externalExecutionId:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
externalExecutionId} -> Maybe Text
externalExecutionId) (\s :: ActionExecutionResult
s@ActionExecutionResult' {} Maybe Text
a -> ActionExecutionResult
s {$sel:externalExecutionId:ActionExecutionResult' :: Maybe Text
externalExecutionId = Maybe Text
a} :: ActionExecutionResult)

-- | The action provider\'s summary for the action execution.
actionExecutionResult_externalExecutionSummary :: Lens.Lens' ActionExecutionResult (Prelude.Maybe Prelude.Text)
actionExecutionResult_externalExecutionSummary :: Lens' ActionExecutionResult (Maybe Text)
actionExecutionResult_externalExecutionSummary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionResult' {Maybe Text
externalExecutionSummary :: Maybe Text
$sel:externalExecutionSummary:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
externalExecutionSummary} -> Maybe Text
externalExecutionSummary) (\s :: ActionExecutionResult
s@ActionExecutionResult' {} Maybe Text
a -> ActionExecutionResult
s {$sel:externalExecutionSummary:ActionExecutionResult' :: Maybe Text
externalExecutionSummary = Maybe Text
a} :: ActionExecutionResult)

-- | The deepest external link to the external resource (for example, a
-- repository URL or deployment endpoint) that is used when running the
-- action.
actionExecutionResult_externalExecutionUrl :: Lens.Lens' ActionExecutionResult (Prelude.Maybe Prelude.Text)
actionExecutionResult_externalExecutionUrl :: Lens' ActionExecutionResult (Maybe Text)
actionExecutionResult_externalExecutionUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionResult' {Maybe Text
externalExecutionUrl :: Maybe Text
$sel:externalExecutionUrl:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
externalExecutionUrl} -> Maybe Text
externalExecutionUrl) (\s :: ActionExecutionResult
s@ActionExecutionResult' {} Maybe Text
a -> ActionExecutionResult
s {$sel:externalExecutionUrl:ActionExecutionResult' :: Maybe Text
externalExecutionUrl = Maybe Text
a} :: ActionExecutionResult)

instance Data.FromJSON ActionExecutionResult where
  parseJSON :: Value -> Parser ActionExecutionResult
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActionExecutionResult"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ActionExecutionResult
ActionExecutionResult'
            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
"externalExecutionId")
            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
"externalExecutionSummary")
            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
"externalExecutionUrl")
      )

instance Prelude.Hashable ActionExecutionResult where
  hashWithSalt :: Int -> ActionExecutionResult -> Int
hashWithSalt Int
_salt ActionExecutionResult' {Maybe Text
externalExecutionUrl :: Maybe Text
externalExecutionSummary :: Maybe Text
externalExecutionId :: Maybe Text
$sel:externalExecutionUrl:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
$sel:externalExecutionSummary:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
$sel:externalExecutionId:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
externalExecutionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
externalExecutionSummary
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
externalExecutionUrl

instance Prelude.NFData ActionExecutionResult where
  rnf :: ActionExecutionResult -> ()
rnf ActionExecutionResult' {Maybe Text
externalExecutionUrl :: Maybe Text
externalExecutionSummary :: Maybe Text
externalExecutionId :: Maybe Text
$sel:externalExecutionUrl:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
$sel:externalExecutionSummary:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
$sel:externalExecutionId:ActionExecutionResult' :: ActionExecutionResult -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
externalExecutionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
externalExecutionSummary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
externalExecutionUrl