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

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

-- | Execution result information, such as the external execution ID.
--
-- /See:/ 'newActionExecutionResult' smart constructor.
data ActionExecutionResult = 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 -> Maybe Text
externalExecutionUrl :: Prelude.Maybe Prelude.Text,
    -- | 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
  }
  deriving (ActionExecutionResult -> ActionExecutionResult -> Bool
(ActionExecutionResult -> ActionExecutionResult -> Bool)
-> (ActionExecutionResult -> ActionExecutionResult -> Bool)
-> Eq ActionExecutionResult
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]
(Int -> ReadS ActionExecutionResult)
-> ReadS [ActionExecutionResult]
-> ReadPrec ActionExecutionResult
-> ReadPrec [ActionExecutionResult]
-> Read 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
(Int -> ActionExecutionResult -> ShowS)
-> (ActionExecutionResult -> String)
-> ([ActionExecutionResult] -> ShowS)
-> Show ActionExecutionResult
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. ActionExecutionResult -> Rep ActionExecutionResult x)
-> (forall x. Rep ActionExecutionResult x -> ActionExecutionResult)
-> Generic ActionExecutionResult
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:
--
-- '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.
--
-- '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.
newActionExecutionResult ::
  ActionExecutionResult
newActionExecutionResult :: ActionExecutionResult
newActionExecutionResult =
  ActionExecutionResult' :: Maybe Text -> Maybe Text -> Maybe Text -> ActionExecutionResult
ActionExecutionResult'
    { $sel:externalExecutionUrl:ActionExecutionResult' :: Maybe Text
externalExecutionUrl =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:externalExecutionId:ActionExecutionResult' :: Maybe Text
externalExecutionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:externalExecutionSummary:ActionExecutionResult' :: Maybe Text
externalExecutionSummary = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ActionExecutionResult -> f ActionExecutionResult
actionExecutionResult_externalExecutionUrl = (ActionExecutionResult -> Maybe Text)
-> (ActionExecutionResult -> Maybe Text -> ActionExecutionResult)
-> Lens
     ActionExecutionResult
     ActionExecutionResult
     (Maybe Text)
     (Maybe Text)
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)

-- | The action provider\'s external ID for the action execution.
actionExecutionResult_externalExecutionId :: Lens.Lens' ActionExecutionResult (Prelude.Maybe Prelude.Text)
actionExecutionResult_externalExecutionId :: (Maybe Text -> f (Maybe Text))
-> ActionExecutionResult -> f ActionExecutionResult
actionExecutionResult_externalExecutionId = (ActionExecutionResult -> Maybe Text)
-> (ActionExecutionResult -> Maybe Text -> ActionExecutionResult)
-> Lens
     ActionExecutionResult
     ActionExecutionResult
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ActionExecutionResult -> f ActionExecutionResult
actionExecutionResult_externalExecutionSummary = (ActionExecutionResult -> Maybe Text)
-> (ActionExecutionResult -> Maybe Text -> ActionExecutionResult)
-> Lens
     ActionExecutionResult
     ActionExecutionResult
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.Hashable ActionExecutionResult

instance Prelude.NFData ActionExecutionResult