{-# 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.CodePipeline.Types.InputArtifact 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
data InputArtifact = InputArtifact'
{
InputArtifact -> Text
name :: Prelude.Text
}
deriving (InputArtifact -> InputArtifact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputArtifact -> InputArtifact -> Bool
$c/= :: InputArtifact -> InputArtifact -> Bool
== :: InputArtifact -> InputArtifact -> Bool
$c== :: InputArtifact -> InputArtifact -> Bool
Prelude.Eq, ReadPrec [InputArtifact]
ReadPrec InputArtifact
Int -> ReadS InputArtifact
ReadS [InputArtifact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputArtifact]
$creadListPrec :: ReadPrec [InputArtifact]
readPrec :: ReadPrec InputArtifact
$creadPrec :: ReadPrec InputArtifact
readList :: ReadS [InputArtifact]
$creadList :: ReadS [InputArtifact]
readsPrec :: Int -> ReadS InputArtifact
$creadsPrec :: Int -> ReadS InputArtifact
Prelude.Read, Int -> InputArtifact -> ShowS
[InputArtifact] -> ShowS
InputArtifact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputArtifact] -> ShowS
$cshowList :: [InputArtifact] -> ShowS
show :: InputArtifact -> String
$cshow :: InputArtifact -> String
showsPrec :: Int -> InputArtifact -> ShowS
$cshowsPrec :: Int -> InputArtifact -> ShowS
Prelude.Show, forall x. Rep InputArtifact x -> InputArtifact
forall x. InputArtifact -> Rep InputArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputArtifact x -> InputArtifact
$cfrom :: forall x. InputArtifact -> Rep InputArtifact x
Prelude.Generic)
newInputArtifact ::
Prelude.Text ->
InputArtifact
newInputArtifact :: Text -> InputArtifact
newInputArtifact Text
pName_ =
InputArtifact' {$sel:name:InputArtifact' :: Text
name = Text
pName_}
inputArtifact_name :: Lens.Lens' InputArtifact Prelude.Text
inputArtifact_name :: Lens' InputArtifact Text
inputArtifact_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputArtifact' {Text
name :: Text
$sel:name:InputArtifact' :: InputArtifact -> Text
name} -> Text
name) (\s :: InputArtifact
s@InputArtifact' {} Text
a -> InputArtifact
s {$sel:name:InputArtifact' :: Text
name = Text
a} :: InputArtifact)
instance Data.FromJSON InputArtifact where
parseJSON :: Value -> Parser InputArtifact
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InputArtifact"
( \Object
x ->
Text -> InputArtifact
InputArtifact' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
)
instance Prelude.Hashable InputArtifact where
hashWithSalt :: Int -> InputArtifact -> Int
hashWithSalt Int
_salt InputArtifact' {Text
name :: Text
$sel:name:InputArtifact' :: InputArtifact -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData InputArtifact where
rnf :: InputArtifact -> ()
rnf InputArtifact' {Text
name :: Text
$sel:name:InputArtifact' :: InputArtifact -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToJSON InputArtifact where
toJSON :: InputArtifact -> Value
toJSON InputArtifact' {Text
name :: Text
$sel:name:InputArtifact' :: InputArtifact -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)]
)