{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CodeReviewType = CodeReviewType'
{
CodeReviewType -> Maybe [AnalysisType]
analysisTypes :: Prelude.Maybe [AnalysisType],
CodeReviewType -> RepositoryAnalysis
repositoryAnalysis :: RepositoryAnalysis
}
deriving (CodeReviewType -> CodeReviewType -> Bool
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]
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
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. 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'
{ $sel:analysisTypes:CodeReviewType' :: Maybe [AnalysisType]
analysisTypes = forall a. Maybe a
Prelude.Nothing,
$sel:repositoryAnalysis:CodeReviewType' :: RepositoryAnalysis
repositoryAnalysis = RepositoryAnalysis
pRepositoryAnalysis_
}
codeReviewType_analysisTypes :: Lens.Lens' CodeReviewType (Prelude.Maybe [AnalysisType])
codeReviewType_analysisTypes :: Lens' CodeReviewType (Maybe [AnalysisType])
codeReviewType_analysisTypes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' CodeReviewType RepositoryAnalysis
codeReviewType_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 where
hashWithSalt :: Int -> CodeReviewType -> Int
hashWithSalt Int
_salt CodeReviewType' {Maybe [AnalysisType]
RepositoryAnalysis
repositoryAnalysis :: RepositoryAnalysis
analysisTypes :: Maybe [AnalysisType]
$sel:repositoryAnalysis:CodeReviewType' :: CodeReviewType -> RepositoryAnalysis
$sel:analysisTypes:CodeReviewType' :: CodeReviewType -> Maybe [AnalysisType]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AnalysisType]
analysisTypes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RepositoryAnalysis
repositoryAnalysis
instance Prelude.NFData CodeReviewType where
rnf :: CodeReviewType -> ()
rnf CodeReviewType' {Maybe [AnalysisType]
RepositoryAnalysis
repositoryAnalysis :: RepositoryAnalysis
analysisTypes :: Maybe [AnalysisType]
$sel:repositoryAnalysis:CodeReviewType' :: CodeReviewType -> RepositoryAnalysis
$sel:analysisTypes:CodeReviewType' :: CodeReviewType -> Maybe [AnalysisType]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AnalysisType]
analysisTypes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RepositoryAnalysis
repositoryAnalysis
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AnalysisTypes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AnalysisType]
analysisTypes,
forall a. a -> Maybe a
Prelude.Just
(Key
"RepositoryAnalysis" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RepositoryAnalysis
repositoryAnalysis)
]
)