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