{-# 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.ActionExecutionInput
-- 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.ActionExecutionInput where

import Amazonka.CodePipeline.Types.ActionTypeId
import Amazonka.CodePipeline.Types.ArtifactDetail
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

-- | Input information used for an action execution.
--
-- /See:/ 'newActionExecutionInput' smart constructor.
data ActionExecutionInput = ActionExecutionInput'
  { ActionExecutionInput -> Maybe ActionTypeId
actionTypeId :: Prelude.Maybe ActionTypeId,
    -- | Configuration data for an action execution.
    ActionExecutionInput -> Maybe (HashMap Text Text)
configuration :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Details of input artifacts of the action that correspond to the action
    -- execution.
    ActionExecutionInput -> Maybe [ArtifactDetail]
inputArtifacts :: Prelude.Maybe [ArtifactDetail],
    -- | The variable namespace associated with the action. All variables
    -- produced as output by this action fall under this namespace.
    ActionExecutionInput -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | The AWS Region for the action, such as us-east-1.
    ActionExecutionInput -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | Configuration data for an action execution with all variable references
    -- replaced with their real values for the execution.
    ActionExecutionInput -> Maybe (HashMap Text Text)
resolvedConfiguration :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ARN of the IAM service role that performs the declared action. This
    -- is assumed through the roleArn for the pipeline.
    ActionExecutionInput -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ActionExecutionInput -> ActionExecutionInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionExecutionInput -> ActionExecutionInput -> Bool
$c/= :: ActionExecutionInput -> ActionExecutionInput -> Bool
== :: ActionExecutionInput -> ActionExecutionInput -> Bool
$c== :: ActionExecutionInput -> ActionExecutionInput -> Bool
Prelude.Eq, ReadPrec [ActionExecutionInput]
ReadPrec ActionExecutionInput
Int -> ReadS ActionExecutionInput
ReadS [ActionExecutionInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionExecutionInput]
$creadListPrec :: ReadPrec [ActionExecutionInput]
readPrec :: ReadPrec ActionExecutionInput
$creadPrec :: ReadPrec ActionExecutionInput
readList :: ReadS [ActionExecutionInput]
$creadList :: ReadS [ActionExecutionInput]
readsPrec :: Int -> ReadS ActionExecutionInput
$creadsPrec :: Int -> ReadS ActionExecutionInput
Prelude.Read, Int -> ActionExecutionInput -> ShowS
[ActionExecutionInput] -> ShowS
ActionExecutionInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionExecutionInput] -> ShowS
$cshowList :: [ActionExecutionInput] -> ShowS
show :: ActionExecutionInput -> String
$cshow :: ActionExecutionInput -> String
showsPrec :: Int -> ActionExecutionInput -> ShowS
$cshowsPrec :: Int -> ActionExecutionInput -> ShowS
Prelude.Show, forall x. Rep ActionExecutionInput x -> ActionExecutionInput
forall x. ActionExecutionInput -> Rep ActionExecutionInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionExecutionInput x -> ActionExecutionInput
$cfrom :: forall x. ActionExecutionInput -> Rep ActionExecutionInput x
Prelude.Generic)

-- |
-- Create a value of 'ActionExecutionInput' 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:
--
-- 'actionTypeId', 'actionExecutionInput_actionTypeId' - Undocumented member.
--
-- 'configuration', 'actionExecutionInput_configuration' - Configuration data for an action execution.
--
-- 'inputArtifacts', 'actionExecutionInput_inputArtifacts' - Details of input artifacts of the action that correspond to the action
-- execution.
--
-- 'namespace', 'actionExecutionInput_namespace' - The variable namespace associated with the action. All variables
-- produced as output by this action fall under this namespace.
--
-- 'region', 'actionExecutionInput_region' - The AWS Region for the action, such as us-east-1.
--
-- 'resolvedConfiguration', 'actionExecutionInput_resolvedConfiguration' - Configuration data for an action execution with all variable references
-- replaced with their real values for the execution.
--
-- 'roleArn', 'actionExecutionInput_roleArn' - The ARN of the IAM service role that performs the declared action. This
-- is assumed through the roleArn for the pipeline.
newActionExecutionInput ::
  ActionExecutionInput
newActionExecutionInput :: ActionExecutionInput
newActionExecutionInput =
  ActionExecutionInput'
    { $sel:actionTypeId:ActionExecutionInput' :: Maybe ActionTypeId
actionTypeId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:configuration:ActionExecutionInput' :: Maybe (HashMap Text Text)
configuration = forall a. Maybe a
Prelude.Nothing,
      $sel:inputArtifacts:ActionExecutionInput' :: Maybe [ArtifactDetail]
inputArtifacts = forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:ActionExecutionInput' :: Maybe Text
namespace = forall a. Maybe a
Prelude.Nothing,
      $sel:region:ActionExecutionInput' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
      $sel:resolvedConfiguration:ActionExecutionInput' :: Maybe (HashMap Text Text)
resolvedConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:ActionExecutionInput' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
actionExecutionInput_actionTypeId :: Lens.Lens' ActionExecutionInput (Prelude.Maybe ActionTypeId)
actionExecutionInput_actionTypeId :: Lens' ActionExecutionInput (Maybe ActionTypeId)
actionExecutionInput_actionTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionInput' {Maybe ActionTypeId
actionTypeId :: Maybe ActionTypeId
$sel:actionTypeId:ActionExecutionInput' :: ActionExecutionInput -> Maybe ActionTypeId
actionTypeId} -> Maybe ActionTypeId
actionTypeId) (\s :: ActionExecutionInput
s@ActionExecutionInput' {} Maybe ActionTypeId
a -> ActionExecutionInput
s {$sel:actionTypeId:ActionExecutionInput' :: Maybe ActionTypeId
actionTypeId = Maybe ActionTypeId
a} :: ActionExecutionInput)

-- | Configuration data for an action execution.
actionExecutionInput_configuration :: Lens.Lens' ActionExecutionInput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
actionExecutionInput_configuration :: Lens' ActionExecutionInput (Maybe (HashMap Text Text))
actionExecutionInput_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionInput' {Maybe (HashMap Text Text)
configuration :: Maybe (HashMap Text Text)
$sel:configuration:ActionExecutionInput' :: ActionExecutionInput -> Maybe (HashMap Text Text)
configuration} -> Maybe (HashMap Text Text)
configuration) (\s :: ActionExecutionInput
s@ActionExecutionInput' {} Maybe (HashMap Text Text)
a -> ActionExecutionInput
s {$sel:configuration:ActionExecutionInput' :: Maybe (HashMap Text Text)
configuration = Maybe (HashMap Text Text)
a} :: ActionExecutionInput) 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

-- | Details of input artifacts of the action that correspond to the action
-- execution.
actionExecutionInput_inputArtifacts :: Lens.Lens' ActionExecutionInput (Prelude.Maybe [ArtifactDetail])
actionExecutionInput_inputArtifacts :: Lens' ActionExecutionInput (Maybe [ArtifactDetail])
actionExecutionInput_inputArtifacts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionInput' {Maybe [ArtifactDetail]
inputArtifacts :: Maybe [ArtifactDetail]
$sel:inputArtifacts:ActionExecutionInput' :: ActionExecutionInput -> Maybe [ArtifactDetail]
inputArtifacts} -> Maybe [ArtifactDetail]
inputArtifacts) (\s :: ActionExecutionInput
s@ActionExecutionInput' {} Maybe [ArtifactDetail]
a -> ActionExecutionInput
s {$sel:inputArtifacts:ActionExecutionInput' :: Maybe [ArtifactDetail]
inputArtifacts = Maybe [ArtifactDetail]
a} :: ActionExecutionInput) 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 variable namespace associated with the action. All variables
-- produced as output by this action fall under this namespace.
actionExecutionInput_namespace :: Lens.Lens' ActionExecutionInput (Prelude.Maybe Prelude.Text)
actionExecutionInput_namespace :: Lens' ActionExecutionInput (Maybe Text)
actionExecutionInput_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionInput' {Maybe Text
namespace :: Maybe Text
$sel:namespace:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: ActionExecutionInput
s@ActionExecutionInput' {} Maybe Text
a -> ActionExecutionInput
s {$sel:namespace:ActionExecutionInput' :: Maybe Text
namespace = Maybe Text
a} :: ActionExecutionInput)

-- | The AWS Region for the action, such as us-east-1.
actionExecutionInput_region :: Lens.Lens' ActionExecutionInput (Prelude.Maybe Prelude.Text)
actionExecutionInput_region :: Lens' ActionExecutionInput (Maybe Text)
actionExecutionInput_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionInput' {Maybe Text
region :: Maybe Text
$sel:region:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
region} -> Maybe Text
region) (\s :: ActionExecutionInput
s@ActionExecutionInput' {} Maybe Text
a -> ActionExecutionInput
s {$sel:region:ActionExecutionInput' :: Maybe Text
region = Maybe Text
a} :: ActionExecutionInput)

-- | Configuration data for an action execution with all variable references
-- replaced with their real values for the execution.
actionExecutionInput_resolvedConfiguration :: Lens.Lens' ActionExecutionInput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
actionExecutionInput_resolvedConfiguration :: Lens' ActionExecutionInput (Maybe (HashMap Text Text))
actionExecutionInput_resolvedConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionInput' {Maybe (HashMap Text Text)
resolvedConfiguration :: Maybe (HashMap Text Text)
$sel:resolvedConfiguration:ActionExecutionInput' :: ActionExecutionInput -> Maybe (HashMap Text Text)
resolvedConfiguration} -> Maybe (HashMap Text Text)
resolvedConfiguration) (\s :: ActionExecutionInput
s@ActionExecutionInput' {} Maybe (HashMap Text Text)
a -> ActionExecutionInput
s {$sel:resolvedConfiguration:ActionExecutionInput' :: Maybe (HashMap Text Text)
resolvedConfiguration = Maybe (HashMap Text Text)
a} :: ActionExecutionInput) 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 ARN of the IAM service role that performs the declared action. This
-- is assumed through the roleArn for the pipeline.
actionExecutionInput_roleArn :: Lens.Lens' ActionExecutionInput (Prelude.Maybe Prelude.Text)
actionExecutionInput_roleArn :: Lens' ActionExecutionInput (Maybe Text)
actionExecutionInput_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionExecutionInput' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: ActionExecutionInput
s@ActionExecutionInput' {} Maybe Text
a -> ActionExecutionInput
s {$sel:roleArn:ActionExecutionInput' :: Maybe Text
roleArn = Maybe Text
a} :: ActionExecutionInput)

instance Data.FromJSON ActionExecutionInput where
  parseJSON :: Value -> Parser ActionExecutionInput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActionExecutionInput"
      ( \Object
x ->
          Maybe ActionTypeId
-> Maybe (HashMap Text Text)
-> Maybe [ArtifactDetail]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ActionExecutionInput
ActionExecutionInput'
            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
"actionTypeId")
            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
"configuration" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"inputArtifacts" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"namespace")
            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
"region")
            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
"resolvedConfiguration"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"roleArn")
      )

instance Prelude.Hashable ActionExecutionInput where
  hashWithSalt :: Int -> ActionExecutionInput -> Int
hashWithSalt Int
_salt ActionExecutionInput' {Maybe [ArtifactDetail]
Maybe Text
Maybe (HashMap Text Text)
Maybe ActionTypeId
roleArn :: Maybe Text
resolvedConfiguration :: Maybe (HashMap Text Text)
region :: Maybe Text
namespace :: Maybe Text
inputArtifacts :: Maybe [ArtifactDetail]
configuration :: Maybe (HashMap Text Text)
actionTypeId :: Maybe ActionTypeId
$sel:roleArn:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
$sel:resolvedConfiguration:ActionExecutionInput' :: ActionExecutionInput -> Maybe (HashMap Text Text)
$sel:region:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
$sel:namespace:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
$sel:inputArtifacts:ActionExecutionInput' :: ActionExecutionInput -> Maybe [ArtifactDetail]
$sel:configuration:ActionExecutionInput' :: ActionExecutionInput -> Maybe (HashMap Text Text)
$sel:actionTypeId:ActionExecutionInput' :: ActionExecutionInput -> Maybe ActionTypeId
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ActionTypeId
actionTypeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
configuration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ArtifactDetail]
inputArtifacts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
resolvedConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn

instance Prelude.NFData ActionExecutionInput where
  rnf :: ActionExecutionInput -> ()
rnf ActionExecutionInput' {Maybe [ArtifactDetail]
Maybe Text
Maybe (HashMap Text Text)
Maybe ActionTypeId
roleArn :: Maybe Text
resolvedConfiguration :: Maybe (HashMap Text Text)
region :: Maybe Text
namespace :: Maybe Text
inputArtifacts :: Maybe [ArtifactDetail]
configuration :: Maybe (HashMap Text Text)
actionTypeId :: Maybe ActionTypeId
$sel:roleArn:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
$sel:resolvedConfiguration:ActionExecutionInput' :: ActionExecutionInput -> Maybe (HashMap Text Text)
$sel:region:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
$sel:namespace:ActionExecutionInput' :: ActionExecutionInput -> Maybe Text
$sel:inputArtifacts:ActionExecutionInput' :: ActionExecutionInput -> Maybe [ArtifactDetail]
$sel:configuration:ActionExecutionInput' :: ActionExecutionInput -> Maybe (HashMap Text Text)
$sel:actionTypeId:ActionExecutionInput' :: ActionExecutionInput -> Maybe ActionTypeId
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ActionTypeId
actionTypeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
configuration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ArtifactDetail]
inputArtifacts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
resolvedConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn