{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ProjectSourceVersion = ProjectSourceVersion'
{
ProjectSourceVersion -> Text
sourceIdentifier :: Prelude.Text,
ProjectSourceVersion -> Text
sourceVersion :: Prelude.Text
}
deriving (ProjectSourceVersion -> ProjectSourceVersion -> Bool
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]
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
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. 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'
{ $sel:sourceIdentifier:ProjectSourceVersion' :: Text
sourceIdentifier =
Text
pSourceIdentifier_,
$sel:sourceVersion:ProjectSourceVersion' :: Text
sourceVersion = Text
pSourceVersion_
}
projectSourceVersion_sourceIdentifier :: Lens.Lens' ProjectSourceVersion Prelude.Text
projectSourceVersion_sourceIdentifier :: Lens' ProjectSourceVersion Text
projectSourceVersion_sourceIdentifier = 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 :: Lens' ProjectSourceVersion Text
projectSourceVersion_sourceVersion = 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 Data.FromJSON ProjectSourceVersion where
parseJSON :: Value -> Parser ProjectSourceVersion
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProjectSourceVersion"
( \Object
x ->
Text -> Text -> ProjectSourceVersion
ProjectSourceVersion'
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
"sourceIdentifier")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"sourceVersion")
)
instance Prelude.Hashable ProjectSourceVersion where
hashWithSalt :: Int -> ProjectSourceVersion -> Int
hashWithSalt Int
_salt ProjectSourceVersion' {Text
sourceVersion :: Text
sourceIdentifier :: Text
$sel:sourceVersion:ProjectSourceVersion' :: ProjectSourceVersion -> Text
$sel:sourceIdentifier:ProjectSourceVersion' :: ProjectSourceVersion -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceVersion
instance Prelude.NFData ProjectSourceVersion where
rnf :: ProjectSourceVersion -> ()
rnf ProjectSourceVersion' {Text
sourceVersion :: Text
sourceIdentifier :: Text
$sel:sourceVersion:ProjectSourceVersion' :: ProjectSourceVersion -> Text
$sel:sourceIdentifier:ProjectSourceVersion' :: ProjectSourceVersion -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
sourceIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceVersion
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"sourceIdentifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sourceIdentifier),
forall a. a -> Maybe a
Prelude.Just
(Key
"sourceVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sourceVersion)
]
)