{-# 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.RepositoryAnalysis where
import Amazonka.CodeGuruReviewer.Types.RepositoryHeadSourceCodeType
import Amazonka.CodeGuruReviewer.Types.SourceCodeType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RepositoryAnalysis = RepositoryAnalysis'
{
RepositoryAnalysis -> Maybe RepositoryHeadSourceCodeType
repositoryHead :: Prelude.Maybe RepositoryHeadSourceCodeType,
RepositoryAnalysis -> Maybe SourceCodeType
sourceCodeType :: Prelude.Maybe SourceCodeType
}
deriving (RepositoryAnalysis -> RepositoryAnalysis -> Bool
(RepositoryAnalysis -> RepositoryAnalysis -> Bool)
-> (RepositoryAnalysis -> RepositoryAnalysis -> Bool)
-> Eq RepositoryAnalysis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositoryAnalysis -> RepositoryAnalysis -> Bool
$c/= :: RepositoryAnalysis -> RepositoryAnalysis -> Bool
== :: RepositoryAnalysis -> RepositoryAnalysis -> Bool
$c== :: RepositoryAnalysis -> RepositoryAnalysis -> Bool
Prelude.Eq, ReadPrec [RepositoryAnalysis]
ReadPrec RepositoryAnalysis
Int -> ReadS RepositoryAnalysis
ReadS [RepositoryAnalysis]
(Int -> ReadS RepositoryAnalysis)
-> ReadS [RepositoryAnalysis]
-> ReadPrec RepositoryAnalysis
-> ReadPrec [RepositoryAnalysis]
-> Read RepositoryAnalysis
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositoryAnalysis]
$creadListPrec :: ReadPrec [RepositoryAnalysis]
readPrec :: ReadPrec RepositoryAnalysis
$creadPrec :: ReadPrec RepositoryAnalysis
readList :: ReadS [RepositoryAnalysis]
$creadList :: ReadS [RepositoryAnalysis]
readsPrec :: Int -> ReadS RepositoryAnalysis
$creadsPrec :: Int -> ReadS RepositoryAnalysis
Prelude.Read, Int -> RepositoryAnalysis -> ShowS
[RepositoryAnalysis] -> ShowS
RepositoryAnalysis -> String
(Int -> RepositoryAnalysis -> ShowS)
-> (RepositoryAnalysis -> String)
-> ([RepositoryAnalysis] -> ShowS)
-> Show RepositoryAnalysis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositoryAnalysis] -> ShowS
$cshowList :: [RepositoryAnalysis] -> ShowS
show :: RepositoryAnalysis -> String
$cshow :: RepositoryAnalysis -> String
showsPrec :: Int -> RepositoryAnalysis -> ShowS
$cshowsPrec :: Int -> RepositoryAnalysis -> ShowS
Prelude.Show, (forall x. RepositoryAnalysis -> Rep RepositoryAnalysis x)
-> (forall x. Rep RepositoryAnalysis x -> RepositoryAnalysis)
-> Generic RepositoryAnalysis
forall x. Rep RepositoryAnalysis x -> RepositoryAnalysis
forall x. RepositoryAnalysis -> Rep RepositoryAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RepositoryAnalysis x -> RepositoryAnalysis
$cfrom :: forall x. RepositoryAnalysis -> Rep RepositoryAnalysis x
Prelude.Generic)
newRepositoryAnalysis ::
RepositoryAnalysis
newRepositoryAnalysis :: RepositoryAnalysis
newRepositoryAnalysis =
RepositoryAnalysis' :: Maybe RepositoryHeadSourceCodeType
-> Maybe SourceCodeType -> RepositoryAnalysis
RepositoryAnalysis'
{ $sel:repositoryHead:RepositoryAnalysis' :: Maybe RepositoryHeadSourceCodeType
repositoryHead =
Maybe RepositoryHeadSourceCodeType
forall a. Maybe a
Prelude.Nothing,
$sel:sourceCodeType:RepositoryAnalysis' :: Maybe SourceCodeType
sourceCodeType = Maybe SourceCodeType
forall a. Maybe a
Prelude.Nothing
}
repositoryAnalysis_repositoryHead :: Lens.Lens' RepositoryAnalysis (Prelude.Maybe RepositoryHeadSourceCodeType)
repositoryAnalysis_repositoryHead :: (Maybe RepositoryHeadSourceCodeType
-> f (Maybe RepositoryHeadSourceCodeType))
-> RepositoryAnalysis -> f RepositoryAnalysis
repositoryAnalysis_repositoryHead = (RepositoryAnalysis -> Maybe RepositoryHeadSourceCodeType)
-> (RepositoryAnalysis
-> Maybe RepositoryHeadSourceCodeType -> RepositoryAnalysis)
-> Lens
RepositoryAnalysis
RepositoryAnalysis
(Maybe RepositoryHeadSourceCodeType)
(Maybe RepositoryHeadSourceCodeType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryAnalysis' {Maybe RepositoryHeadSourceCodeType
repositoryHead :: Maybe RepositoryHeadSourceCodeType
$sel:repositoryHead:RepositoryAnalysis' :: RepositoryAnalysis -> Maybe RepositoryHeadSourceCodeType
repositoryHead} -> Maybe RepositoryHeadSourceCodeType
repositoryHead) (\s :: RepositoryAnalysis
s@RepositoryAnalysis' {} Maybe RepositoryHeadSourceCodeType
a -> RepositoryAnalysis
s {$sel:repositoryHead:RepositoryAnalysis' :: Maybe RepositoryHeadSourceCodeType
repositoryHead = Maybe RepositoryHeadSourceCodeType
a} :: RepositoryAnalysis)
repositoryAnalysis_sourceCodeType :: Lens.Lens' RepositoryAnalysis (Prelude.Maybe SourceCodeType)
repositoryAnalysis_sourceCodeType :: (Maybe SourceCodeType -> f (Maybe SourceCodeType))
-> RepositoryAnalysis -> f RepositoryAnalysis
repositoryAnalysis_sourceCodeType = (RepositoryAnalysis -> Maybe SourceCodeType)
-> (RepositoryAnalysis
-> Maybe SourceCodeType -> RepositoryAnalysis)
-> Lens
RepositoryAnalysis
RepositoryAnalysis
(Maybe SourceCodeType)
(Maybe SourceCodeType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryAnalysis' {Maybe SourceCodeType
sourceCodeType :: Maybe SourceCodeType
$sel:sourceCodeType:RepositoryAnalysis' :: RepositoryAnalysis -> Maybe SourceCodeType
sourceCodeType} -> Maybe SourceCodeType
sourceCodeType) (\s :: RepositoryAnalysis
s@RepositoryAnalysis' {} Maybe SourceCodeType
a -> RepositoryAnalysis
s {$sel:sourceCodeType:RepositoryAnalysis' :: Maybe SourceCodeType
sourceCodeType = Maybe SourceCodeType
a} :: RepositoryAnalysis)
instance Prelude.Hashable RepositoryAnalysis
instance Prelude.NFData RepositoryAnalysis
instance Core.ToJSON RepositoryAnalysis where
toJSON :: RepositoryAnalysis -> Value
toJSON RepositoryAnalysis' {Maybe RepositoryHeadSourceCodeType
Maybe SourceCodeType
sourceCodeType :: Maybe SourceCodeType
repositoryHead :: Maybe RepositoryHeadSourceCodeType
$sel:sourceCodeType:RepositoryAnalysis' :: RepositoryAnalysis -> Maybe SourceCodeType
$sel:repositoryHead:RepositoryAnalysis' :: RepositoryAnalysis -> Maybe RepositoryHeadSourceCodeType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RepositoryHead" Text -> RepositoryHeadSourceCodeType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RepositoryHeadSourceCodeType -> Pair)
-> Maybe RepositoryHeadSourceCodeType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RepositoryHeadSourceCodeType
repositoryHead,
(Text
"SourceCodeType" Text -> SourceCodeType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SourceCodeType -> Pair) -> Maybe SourceCodeType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceCodeType
sourceCodeType
]
)