{-# 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 #-}
module Amazonka.CodeStar.Types.Toolchain where
import Amazonka.CodeStar.Types.ToolchainSource
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Toolchain = Toolchain'
{
Toolchain -> Maybe (HashMap Text (Sensitive Text))
stackParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
Toolchain -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
Toolchain -> ToolchainSource
source :: ToolchainSource
}
deriving (Toolchain -> Toolchain -> Bool
(Toolchain -> Toolchain -> Bool)
-> (Toolchain -> Toolchain -> Bool) -> Eq Toolchain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Toolchain -> Toolchain -> Bool
$c/= :: Toolchain -> Toolchain -> Bool
== :: Toolchain -> Toolchain -> Bool
$c== :: Toolchain -> Toolchain -> Bool
Prelude.Eq, Int -> Toolchain -> ShowS
[Toolchain] -> ShowS
Toolchain -> String
(Int -> Toolchain -> ShowS)
-> (Toolchain -> String)
-> ([Toolchain] -> ShowS)
-> Show Toolchain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Toolchain] -> ShowS
$cshowList :: [Toolchain] -> ShowS
show :: Toolchain -> String
$cshow :: Toolchain -> String
showsPrec :: Int -> Toolchain -> ShowS
$cshowsPrec :: Int -> Toolchain -> ShowS
Prelude.Show, (forall x. Toolchain -> Rep Toolchain x)
-> (forall x. Rep Toolchain x -> Toolchain) -> Generic Toolchain
forall x. Rep Toolchain x -> Toolchain
forall x. Toolchain -> Rep Toolchain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Toolchain x -> Toolchain
$cfrom :: forall x. Toolchain -> Rep Toolchain x
Prelude.Generic)
newToolchain ::
ToolchainSource ->
Toolchain
newToolchain :: ToolchainSource -> Toolchain
newToolchain ToolchainSource
pSource_ =
Toolchain' :: Maybe (HashMap Text (Sensitive Text))
-> Maybe Text -> ToolchainSource -> Toolchain
Toolchain'
{ $sel:stackParameters:Toolchain' :: Maybe (HashMap Text (Sensitive Text))
stackParameters = Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:Toolchain' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:source:Toolchain' :: ToolchainSource
source = ToolchainSource
pSource_
}
toolchain_stackParameters :: Lens.Lens' Toolchain (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
toolchain_stackParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Toolchain -> f Toolchain
toolchain_stackParameters = (Toolchain -> Maybe (HashMap Text (Sensitive Text)))
-> (Toolchain
-> Maybe (HashMap Text (Sensitive Text)) -> Toolchain)
-> Lens
Toolchain
Toolchain
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Toolchain' {Maybe (HashMap Text (Sensitive Text))
stackParameters :: Maybe (HashMap Text (Sensitive Text))
$sel:stackParameters:Toolchain' :: Toolchain -> Maybe (HashMap Text (Sensitive Text))
stackParameters} -> Maybe (HashMap Text (Sensitive Text))
stackParameters) (\s :: Toolchain
s@Toolchain' {} Maybe (HashMap Text (Sensitive Text))
a -> Toolchain
s {$sel:stackParameters:Toolchain' :: Maybe (HashMap Text (Sensitive Text))
stackParameters = Maybe (HashMap Text (Sensitive Text))
a} :: Toolchain) ((Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> Toolchain -> f Toolchain)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Toolchain
-> f Toolchain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
toolchain_roleArn :: Lens.Lens' Toolchain (Prelude.Maybe Prelude.Text)
toolchain_roleArn :: (Maybe Text -> f (Maybe Text)) -> Toolchain -> f Toolchain
toolchain_roleArn = (Toolchain -> Maybe Text)
-> (Toolchain -> Maybe Text -> Toolchain)
-> Lens Toolchain Toolchain (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Toolchain' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:Toolchain' :: Toolchain -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: Toolchain
s@Toolchain' {} Maybe Text
a -> Toolchain
s {$sel:roleArn:Toolchain' :: Maybe Text
roleArn = Maybe Text
a} :: Toolchain)
toolchain_source :: Lens.Lens' Toolchain ToolchainSource
toolchain_source :: (ToolchainSource -> f ToolchainSource) -> Toolchain -> f Toolchain
toolchain_source = (Toolchain -> ToolchainSource)
-> (Toolchain -> ToolchainSource -> Toolchain)
-> Lens Toolchain Toolchain ToolchainSource ToolchainSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Toolchain' {ToolchainSource
source :: ToolchainSource
$sel:source:Toolchain' :: Toolchain -> ToolchainSource
source} -> ToolchainSource
source) (\s :: Toolchain
s@Toolchain' {} ToolchainSource
a -> Toolchain
s {$sel:source:Toolchain' :: ToolchainSource
source = ToolchainSource
a} :: Toolchain)
instance Prelude.Hashable Toolchain
instance Prelude.NFData Toolchain
instance Core.ToJSON Toolchain where
toJSON :: Toolchain -> Value
toJSON Toolchain' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
ToolchainSource
source :: ToolchainSource
roleArn :: Maybe Text
stackParameters :: Maybe (HashMap Text (Sensitive Text))
$sel:source:Toolchain' :: Toolchain -> ToolchainSource
$sel:roleArn:Toolchain' :: Toolchain -> Maybe Text
$sel:stackParameters:Toolchain' :: Toolchain -> Maybe (HashMap Text (Sensitive Text))
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"stackParameters" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text (Sensitive Text) -> Pair)
-> Maybe (HashMap Text (Sensitive Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text (Sensitive Text))
stackParameters,
(Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"source" Text -> ToolchainSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ToolchainSource
source)
]
)