{-# 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.Repository where
import Amazonka.CodeGuruReviewer.Types.CodeCommitRepository
import Amazonka.CodeGuruReviewer.Types.S3Repository
import Amazonka.CodeGuruReviewer.Types.ThirdPartySourceRepository
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Repository = Repository'
{
Repository -> Maybe CodeCommitRepository
codeCommit :: Prelude.Maybe CodeCommitRepository,
Repository -> Maybe ThirdPartySourceRepository
gitHubEnterpriseServer :: Prelude.Maybe ThirdPartySourceRepository,
Repository -> Maybe S3Repository
s3Bucket :: Prelude.Maybe S3Repository,
Repository -> Maybe ThirdPartySourceRepository
bitbucket :: Prelude.Maybe ThirdPartySourceRepository
}
deriving (Repository -> Repository -> Bool
(Repository -> Repository -> Bool)
-> (Repository -> Repository -> Bool) -> Eq Repository
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Repository -> Repository -> Bool
$c/= :: Repository -> Repository -> Bool
== :: Repository -> Repository -> Bool
$c== :: Repository -> Repository -> Bool
Prelude.Eq, ReadPrec [Repository]
ReadPrec Repository
Int -> ReadS Repository
ReadS [Repository]
(Int -> ReadS Repository)
-> ReadS [Repository]
-> ReadPrec Repository
-> ReadPrec [Repository]
-> Read Repository
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Repository]
$creadListPrec :: ReadPrec [Repository]
readPrec :: ReadPrec Repository
$creadPrec :: ReadPrec Repository
readList :: ReadS [Repository]
$creadList :: ReadS [Repository]
readsPrec :: Int -> ReadS Repository
$creadsPrec :: Int -> ReadS Repository
Prelude.Read, Int -> Repository -> ShowS
[Repository] -> ShowS
Repository -> String
(Int -> Repository -> ShowS)
-> (Repository -> String)
-> ([Repository] -> ShowS)
-> Show Repository
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Repository] -> ShowS
$cshowList :: [Repository] -> ShowS
show :: Repository -> String
$cshow :: Repository -> String
showsPrec :: Int -> Repository -> ShowS
$cshowsPrec :: Int -> Repository -> ShowS
Prelude.Show, (forall x. Repository -> Rep Repository x)
-> (forall x. Rep Repository x -> Repository) -> Generic Repository
forall x. Rep Repository x -> Repository
forall x. Repository -> Rep Repository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Repository x -> Repository
$cfrom :: forall x. Repository -> Rep Repository x
Prelude.Generic)
newRepository ::
Repository
newRepository :: Repository
newRepository =
Repository' :: Maybe CodeCommitRepository
-> Maybe ThirdPartySourceRepository
-> Maybe S3Repository
-> Maybe ThirdPartySourceRepository
-> Repository
Repository'
{ $sel:codeCommit:Repository' :: Maybe CodeCommitRepository
codeCommit = Maybe CodeCommitRepository
forall a. Maybe a
Prelude.Nothing,
$sel:gitHubEnterpriseServer:Repository' :: Maybe ThirdPartySourceRepository
gitHubEnterpriseServer = Maybe ThirdPartySourceRepository
forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:Repository' :: Maybe S3Repository
s3Bucket = Maybe S3Repository
forall a. Maybe a
Prelude.Nothing,
$sel:bitbucket:Repository' :: Maybe ThirdPartySourceRepository
bitbucket = Maybe ThirdPartySourceRepository
forall a. Maybe a
Prelude.Nothing
}
repository_codeCommit :: Lens.Lens' Repository (Prelude.Maybe CodeCommitRepository)
repository_codeCommit :: (Maybe CodeCommitRepository -> f (Maybe CodeCommitRepository))
-> Repository -> f Repository
repository_codeCommit = (Repository -> Maybe CodeCommitRepository)
-> (Repository -> Maybe CodeCommitRepository -> Repository)
-> Lens
Repository
Repository
(Maybe CodeCommitRepository)
(Maybe CodeCommitRepository)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Maybe CodeCommitRepository
codeCommit :: Maybe CodeCommitRepository
$sel:codeCommit:Repository' :: Repository -> Maybe CodeCommitRepository
codeCommit} -> Maybe CodeCommitRepository
codeCommit) (\s :: Repository
s@Repository' {} Maybe CodeCommitRepository
a -> Repository
s {$sel:codeCommit:Repository' :: Maybe CodeCommitRepository
codeCommit = Maybe CodeCommitRepository
a} :: Repository)
repository_gitHubEnterpriseServer :: Lens.Lens' Repository (Prelude.Maybe ThirdPartySourceRepository)
repository_gitHubEnterpriseServer :: (Maybe ThirdPartySourceRepository
-> f (Maybe ThirdPartySourceRepository))
-> Repository -> f Repository
repository_gitHubEnterpriseServer = (Repository -> Maybe ThirdPartySourceRepository)
-> (Repository -> Maybe ThirdPartySourceRepository -> Repository)
-> Lens
Repository
Repository
(Maybe ThirdPartySourceRepository)
(Maybe ThirdPartySourceRepository)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Maybe ThirdPartySourceRepository
gitHubEnterpriseServer :: Maybe ThirdPartySourceRepository
$sel:gitHubEnterpriseServer:Repository' :: Repository -> Maybe ThirdPartySourceRepository
gitHubEnterpriseServer} -> Maybe ThirdPartySourceRepository
gitHubEnterpriseServer) (\s :: Repository
s@Repository' {} Maybe ThirdPartySourceRepository
a -> Repository
s {$sel:gitHubEnterpriseServer:Repository' :: Maybe ThirdPartySourceRepository
gitHubEnterpriseServer = Maybe ThirdPartySourceRepository
a} :: Repository)
repository_s3Bucket :: Lens.Lens' Repository (Prelude.Maybe S3Repository)
repository_s3Bucket :: (Maybe S3Repository -> f (Maybe S3Repository))
-> Repository -> f Repository
repository_s3Bucket = (Repository -> Maybe S3Repository)
-> (Repository -> Maybe S3Repository -> Repository)
-> Lens
Repository Repository (Maybe S3Repository) (Maybe S3Repository)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Maybe S3Repository
s3Bucket :: Maybe S3Repository
$sel:s3Bucket:Repository' :: Repository -> Maybe S3Repository
s3Bucket} -> Maybe S3Repository
s3Bucket) (\s :: Repository
s@Repository' {} Maybe S3Repository
a -> Repository
s {$sel:s3Bucket:Repository' :: Maybe S3Repository
s3Bucket = Maybe S3Repository
a} :: Repository)
repository_bitbucket :: Lens.Lens' Repository (Prelude.Maybe ThirdPartySourceRepository)
repository_bitbucket :: (Maybe ThirdPartySourceRepository
-> f (Maybe ThirdPartySourceRepository))
-> Repository -> f Repository
repository_bitbucket = (Repository -> Maybe ThirdPartySourceRepository)
-> (Repository -> Maybe ThirdPartySourceRepository -> Repository)
-> Lens
Repository
Repository
(Maybe ThirdPartySourceRepository)
(Maybe ThirdPartySourceRepository)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Maybe ThirdPartySourceRepository
bitbucket :: Maybe ThirdPartySourceRepository
$sel:bitbucket:Repository' :: Repository -> Maybe ThirdPartySourceRepository
bitbucket} -> Maybe ThirdPartySourceRepository
bitbucket) (\s :: Repository
s@Repository' {} Maybe ThirdPartySourceRepository
a -> Repository
s {$sel:bitbucket:Repository' :: Maybe ThirdPartySourceRepository
bitbucket = Maybe ThirdPartySourceRepository
a} :: Repository)
instance Prelude.Hashable Repository
instance Prelude.NFData Repository
instance Core.ToJSON Repository where
toJSON :: Repository -> Value
toJSON Repository' {Maybe CodeCommitRepository
Maybe S3Repository
Maybe ThirdPartySourceRepository
bitbucket :: Maybe ThirdPartySourceRepository
s3Bucket :: Maybe S3Repository
gitHubEnterpriseServer :: Maybe ThirdPartySourceRepository
codeCommit :: Maybe CodeCommitRepository
$sel:bitbucket:Repository' :: Repository -> Maybe ThirdPartySourceRepository
$sel:s3Bucket:Repository' :: Repository -> Maybe S3Repository
$sel:gitHubEnterpriseServer:Repository' :: Repository -> Maybe ThirdPartySourceRepository
$sel:codeCommit:Repository' :: Repository -> Maybe CodeCommitRepository
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CodeCommit" Text -> CodeCommitRepository -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CodeCommitRepository -> Pair)
-> Maybe CodeCommitRepository -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CodeCommitRepository
codeCommit,
(Text
"GitHubEnterpriseServer" Text -> ThirdPartySourceRepository -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ThirdPartySourceRepository -> Pair)
-> Maybe ThirdPartySourceRepository -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ThirdPartySourceRepository
gitHubEnterpriseServer,
(Text
"S3Bucket" Text -> S3Repository -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3Repository -> Pair) -> Maybe S3Repository -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3Repository
s3Bucket,
(Text
"Bitbucket" Text -> ThirdPartySourceRepository -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ThirdPartySourceRepository -> Pair)
-> Maybe ThirdPartySourceRepository -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ThirdPartySourceRepository
bitbucket
]
)