{-# 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.CodeReviewType where
import Amazonka.CodeGuruReviewer.Types.AnalysisType
import Amazonka.CodeGuruReviewer.Types.RepositoryAnalysis
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CodeReviewType = CodeReviewType'
{
CodeReviewType -> Maybe [AnalysisType]
analysisTypes :: Prelude.Maybe [AnalysisType],
CodeReviewType -> RepositoryAnalysis
repositoryAnalysis :: RepositoryAnalysis
}
deriving (CodeReviewType -> CodeReviewType -> Bool
(CodeReviewType -> CodeReviewType -> Bool)
-> (CodeReviewType -> CodeReviewType -> Bool) -> Eq CodeReviewType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeReviewType -> CodeReviewType -> Bool
$c/= :: CodeReviewType -> CodeReviewType -> Bool
== :: CodeReviewType -> CodeReviewType -> Bool
$c== :: CodeReviewType -> CodeReviewType -> Bool
Prelude.Eq, ReadPrec [CodeReviewType]
ReadPrec CodeReviewType
Int -> ReadS CodeReviewType
ReadS [CodeReviewType]
(Int -> ReadS CodeReviewType)
-> ReadS [CodeReviewType]
-> ReadPrec CodeReviewType
-> ReadPrec [CodeReviewType]
-> Read CodeReviewType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CodeReviewType]
$creadListPrec :: ReadPrec [CodeReviewType]
readPrec :: ReadPrec CodeReviewType
$creadPrec :: ReadPrec CodeReviewType
readList :: ReadS [CodeReviewType]
$creadList :: ReadS [CodeReviewType]
readsPrec :: Int -> ReadS CodeReviewType
$creadsPrec :: Int -> ReadS CodeReviewType
Prelude.Read, Int -> CodeReviewType -> ShowS
[CodeReviewType] -> ShowS
CodeReviewType -> String
(Int -> CodeReviewType -> ShowS)
-> (CodeReviewType -> String)
-> ([CodeReviewType] -> ShowS)
-> Show CodeReviewType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeReviewType] -> ShowS
$cshowList :: [CodeReviewType] -> ShowS
show :: CodeReviewType -> String
$cshow :: CodeReviewType -> String
showsPrec :: Int -> CodeReviewType -> ShowS
$cshowsPrec :: Int -> CodeReviewType -> ShowS
Prelude.Show, (forall x. CodeReviewType -> Rep CodeReviewType x)
-> (forall x. Rep CodeReviewType x -> CodeReviewType)
-> Generic CodeReviewType
forall x. Rep CodeReviewType x -> CodeReviewType
forall x. CodeReviewType -> Rep CodeReviewType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeReviewType x -> CodeReviewType
$cfrom :: forall x. CodeReviewType -> Rep CodeReviewType x
Prelude.Generic)
newCodeReviewType ::
RepositoryAnalysis ->
CodeReviewType
newCodeReviewType :: RepositoryAnalysis -> CodeReviewType
newCodeReviewType RepositoryAnalysis
pRepositoryAnalysis_ =
CodeReviewType' :: Maybe [AnalysisType] -> RepositoryAnalysis -> CodeReviewType
CodeReviewType'
{ $sel:analysisTypes:CodeReviewType' :: Maybe [AnalysisType]
analysisTypes = Maybe [AnalysisType]
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryAnalysis:CodeReviewType' :: RepositoryAnalysis
repositoryAnalysis = RepositoryAnalysis
pRepositoryAnalysis_
}
codeReviewType_analysisTypes :: Lens.Lens' CodeReviewType (Prelude.Maybe [AnalysisType])
codeReviewType_analysisTypes :: (Maybe [AnalysisType] -> f (Maybe [AnalysisType]))
-> CodeReviewType -> f CodeReviewType
codeReviewType_analysisTypes = (CodeReviewType -> Maybe [AnalysisType])
-> (CodeReviewType -> Maybe [AnalysisType] -> CodeReviewType)
-> Lens
CodeReviewType
CodeReviewType
(Maybe [AnalysisType])
(Maybe [AnalysisType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeReviewType' {Maybe [AnalysisType]
analysisTypes :: Maybe [AnalysisType]
$sel:analysisTypes:CodeReviewType' :: CodeReviewType -> Maybe [AnalysisType]
analysisTypes} -> Maybe [AnalysisType]
analysisTypes) (\s :: CodeReviewType
s@CodeReviewType' {} Maybe [AnalysisType]
a -> CodeReviewType
s {$sel:analysisTypes:CodeReviewType' :: Maybe [AnalysisType]
analysisTypes = Maybe [AnalysisType]
a} :: CodeReviewType) ((Maybe [AnalysisType] -> f (Maybe [AnalysisType]))
-> CodeReviewType -> f CodeReviewType)
-> ((Maybe [AnalysisType] -> f (Maybe [AnalysisType]))
-> Maybe [AnalysisType] -> f (Maybe [AnalysisType]))
-> (Maybe [AnalysisType] -> f (Maybe [AnalysisType]))
-> CodeReviewType
-> f CodeReviewType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AnalysisType] [AnalysisType] [AnalysisType] [AnalysisType]
-> Iso
(Maybe [AnalysisType])
(Maybe [AnalysisType])
(Maybe [AnalysisType])
(Maybe [AnalysisType])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [AnalysisType] [AnalysisType] [AnalysisType] [AnalysisType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
codeReviewType_repositoryAnalysis :: Lens.Lens' CodeReviewType RepositoryAnalysis
codeReviewType_repositoryAnalysis :: (RepositoryAnalysis -> f RepositoryAnalysis)
-> CodeReviewType -> f CodeReviewType
codeReviewType_repositoryAnalysis = (CodeReviewType -> RepositoryAnalysis)
-> (CodeReviewType -> RepositoryAnalysis -> CodeReviewType)
-> Lens
CodeReviewType CodeReviewType RepositoryAnalysis RepositoryAnalysis
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeReviewType' {RepositoryAnalysis
repositoryAnalysis :: RepositoryAnalysis
$sel:repositoryAnalysis:CodeReviewType' :: CodeReviewType -> RepositoryAnalysis
repositoryAnalysis} -> RepositoryAnalysis
repositoryAnalysis) (\s :: CodeReviewType
s@CodeReviewType' {} RepositoryAnalysis
a -> CodeReviewType
s {$sel:repositoryAnalysis:CodeReviewType' :: RepositoryAnalysis
repositoryAnalysis = RepositoryAnalysis
a} :: CodeReviewType)
instance Prelude.Hashable CodeReviewType
instance Prelude.NFData CodeReviewType
instance Core.ToJSON CodeReviewType where
toJSON :: CodeReviewType -> Value
toJSON CodeReviewType' {Maybe [AnalysisType]
RepositoryAnalysis
repositoryAnalysis :: RepositoryAnalysis
analysisTypes :: Maybe [AnalysisType]
$sel:repositoryAnalysis:CodeReviewType' :: CodeReviewType -> RepositoryAnalysis
$sel:analysisTypes:CodeReviewType' :: CodeReviewType -> Maybe [AnalysisType]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AnalysisTypes" Text -> [AnalysisType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AnalysisType] -> Pair) -> Maybe [AnalysisType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AnalysisType]
analysisTypes,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RepositoryAnalysis" Text -> RepositoryAnalysis -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RepositoryAnalysis
repositoryAnalysis)
]
)