{-# 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.CodeBuild.Types.ProjectSourceVersion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProjectSourceVersion = ProjectSourceVersion'
{
ProjectSourceVersion -> Text
sourceIdentifier :: Prelude.Text,
ProjectSourceVersion -> Text
sourceVersion :: Prelude.Text
}
deriving (ProjectSourceVersion -> ProjectSourceVersion -> Bool
(ProjectSourceVersion -> ProjectSourceVersion -> Bool)
-> (ProjectSourceVersion -> ProjectSourceVersion -> Bool)
-> Eq ProjectSourceVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectSourceVersion -> ProjectSourceVersion -> Bool
$c/= :: ProjectSourceVersion -> ProjectSourceVersion -> Bool
== :: ProjectSourceVersion -> ProjectSourceVersion -> Bool
$c== :: ProjectSourceVersion -> ProjectSourceVersion -> Bool
Prelude.Eq, ReadPrec [ProjectSourceVersion]
ReadPrec ProjectSourceVersion
Int -> ReadS ProjectSourceVersion
ReadS [ProjectSourceVersion]
(Int -> ReadS ProjectSourceVersion)
-> ReadS [ProjectSourceVersion]
-> ReadPrec ProjectSourceVersion
-> ReadPrec [ProjectSourceVersion]
-> Read ProjectSourceVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectSourceVersion]
$creadListPrec :: ReadPrec [ProjectSourceVersion]
readPrec :: ReadPrec ProjectSourceVersion
$creadPrec :: ReadPrec ProjectSourceVersion
readList :: ReadS [ProjectSourceVersion]
$creadList :: ReadS [ProjectSourceVersion]
readsPrec :: Int -> ReadS ProjectSourceVersion
$creadsPrec :: Int -> ReadS ProjectSourceVersion
Prelude.Read, Int -> ProjectSourceVersion -> ShowS
[ProjectSourceVersion] -> ShowS
ProjectSourceVersion -> String
(Int -> ProjectSourceVersion -> ShowS)
-> (ProjectSourceVersion -> String)
-> ([ProjectSourceVersion] -> ShowS)
-> Show ProjectSourceVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectSourceVersion] -> ShowS
$cshowList :: [ProjectSourceVersion] -> ShowS
show :: ProjectSourceVersion -> String
$cshow :: ProjectSourceVersion -> String
showsPrec :: Int -> ProjectSourceVersion -> ShowS
$cshowsPrec :: Int -> ProjectSourceVersion -> ShowS
Prelude.Show, (forall x. ProjectSourceVersion -> Rep ProjectSourceVersion x)
-> (forall x. Rep ProjectSourceVersion x -> ProjectSourceVersion)
-> Generic ProjectSourceVersion
forall x. Rep ProjectSourceVersion x -> ProjectSourceVersion
forall x. ProjectSourceVersion -> Rep ProjectSourceVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectSourceVersion x -> ProjectSourceVersion
$cfrom :: forall x. ProjectSourceVersion -> Rep ProjectSourceVersion x
Prelude.Generic)
newProjectSourceVersion ::
Prelude.Text ->
Prelude.Text ->
ProjectSourceVersion
newProjectSourceVersion :: Text -> Text -> ProjectSourceVersion
newProjectSourceVersion
Text
pSourceIdentifier_
Text
pSourceVersion_ =
ProjectSourceVersion' :: Text -> Text -> ProjectSourceVersion
ProjectSourceVersion'
{ $sel:sourceIdentifier:ProjectSourceVersion' :: Text
sourceIdentifier =
Text
pSourceIdentifier_,
$sel:sourceVersion:ProjectSourceVersion' :: Text
sourceVersion = Text
pSourceVersion_
}
projectSourceVersion_sourceIdentifier :: Lens.Lens' ProjectSourceVersion Prelude.Text
projectSourceVersion_sourceIdentifier :: (Text -> f Text) -> ProjectSourceVersion -> f ProjectSourceVersion
projectSourceVersion_sourceIdentifier = (ProjectSourceVersion -> Text)
-> (ProjectSourceVersion -> Text -> ProjectSourceVersion)
-> Lens ProjectSourceVersion ProjectSourceVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSourceVersion' {Text
sourceIdentifier :: Text
$sel:sourceIdentifier:ProjectSourceVersion' :: ProjectSourceVersion -> Text
sourceIdentifier} -> Text
sourceIdentifier) (\s :: ProjectSourceVersion
s@ProjectSourceVersion' {} Text
a -> ProjectSourceVersion
s {$sel:sourceIdentifier:ProjectSourceVersion' :: Text
sourceIdentifier = Text
a} :: ProjectSourceVersion)
projectSourceVersion_sourceVersion :: Lens.Lens' ProjectSourceVersion Prelude.Text
projectSourceVersion_sourceVersion :: (Text -> f Text) -> ProjectSourceVersion -> f ProjectSourceVersion
projectSourceVersion_sourceVersion = (ProjectSourceVersion -> Text)
-> (ProjectSourceVersion -> Text -> ProjectSourceVersion)
-> Lens ProjectSourceVersion ProjectSourceVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSourceVersion' {Text
sourceVersion :: Text
$sel:sourceVersion:ProjectSourceVersion' :: ProjectSourceVersion -> Text
sourceVersion} -> Text
sourceVersion) (\s :: ProjectSourceVersion
s@ProjectSourceVersion' {} Text
a -> ProjectSourceVersion
s {$sel:sourceVersion:ProjectSourceVersion' :: Text
sourceVersion = Text
a} :: ProjectSourceVersion)
instance Core.FromJSON ProjectSourceVersion where
parseJSON :: Value -> Parser ProjectSourceVersion
parseJSON =
String
-> (Object -> Parser ProjectSourceVersion)
-> Value
-> Parser ProjectSourceVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProjectSourceVersion"
( \Object
x ->
Text -> Text -> ProjectSourceVersion
ProjectSourceVersion'
(Text -> Text -> ProjectSourceVersion)
-> Parser Text -> Parser (Text -> ProjectSourceVersion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"sourceIdentifier")
Parser (Text -> ProjectSourceVersion)
-> Parser Text -> Parser ProjectSourceVersion
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"sourceVersion")
)
instance Prelude.Hashable ProjectSourceVersion
instance Prelude.NFData ProjectSourceVersion
instance Core.ToJSON ProjectSourceVersion where
toJSON :: ProjectSourceVersion -> Value
toJSON ProjectSourceVersion' {Text
sourceVersion :: Text
sourceIdentifier :: Text
$sel:sourceVersion:ProjectSourceVersion' :: ProjectSourceVersion -> Text
$sel:sourceIdentifier:ProjectSourceVersion' :: ProjectSourceVersion -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"sourceIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceIdentifier),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"sourceVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceVersion)
]
)