{-# 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.S3Repository where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3Repository = S3Repository'
{
S3Repository -> Text
name :: Prelude.Text,
S3Repository -> Text
bucketName :: Prelude.Text
}
deriving (S3Repository -> S3Repository -> Bool
(S3Repository -> S3Repository -> Bool)
-> (S3Repository -> S3Repository -> Bool) -> Eq S3Repository
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3Repository -> S3Repository -> Bool
$c/= :: S3Repository -> S3Repository -> Bool
== :: S3Repository -> S3Repository -> Bool
$c== :: S3Repository -> S3Repository -> Bool
Prelude.Eq, ReadPrec [S3Repository]
ReadPrec S3Repository
Int -> ReadS S3Repository
ReadS [S3Repository]
(Int -> ReadS S3Repository)
-> ReadS [S3Repository]
-> ReadPrec S3Repository
-> ReadPrec [S3Repository]
-> Read S3Repository
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3Repository]
$creadListPrec :: ReadPrec [S3Repository]
readPrec :: ReadPrec S3Repository
$creadPrec :: ReadPrec S3Repository
readList :: ReadS [S3Repository]
$creadList :: ReadS [S3Repository]
readsPrec :: Int -> ReadS S3Repository
$creadsPrec :: Int -> ReadS S3Repository
Prelude.Read, Int -> S3Repository -> ShowS
[S3Repository] -> ShowS
S3Repository -> String
(Int -> S3Repository -> ShowS)
-> (S3Repository -> String)
-> ([S3Repository] -> ShowS)
-> Show S3Repository
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3Repository] -> ShowS
$cshowList :: [S3Repository] -> ShowS
show :: S3Repository -> String
$cshow :: S3Repository -> String
showsPrec :: Int -> S3Repository -> ShowS
$cshowsPrec :: Int -> S3Repository -> ShowS
Prelude.Show, (forall x. S3Repository -> Rep S3Repository x)
-> (forall x. Rep S3Repository x -> S3Repository)
-> Generic S3Repository
forall x. Rep S3Repository x -> S3Repository
forall x. S3Repository -> Rep S3Repository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3Repository x -> S3Repository
$cfrom :: forall x. S3Repository -> Rep S3Repository x
Prelude.Generic)
newS3Repository ::
Prelude.Text ->
Prelude.Text ->
S3Repository
newS3Repository :: Text -> Text -> S3Repository
newS3Repository Text
pName_ Text
pBucketName_ =
S3Repository' :: Text -> Text -> S3Repository
S3Repository'
{ $sel:name:S3Repository' :: Text
name = Text
pName_,
$sel:bucketName:S3Repository' :: Text
bucketName = Text
pBucketName_
}
s3Repository_name :: Lens.Lens' S3Repository Prelude.Text
s3Repository_name :: (Text -> f Text) -> S3Repository -> f S3Repository
s3Repository_name = (S3Repository -> Text)
-> (S3Repository -> Text -> S3Repository)
-> Lens S3Repository S3Repository Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Repository' {Text
name :: Text
$sel:name:S3Repository' :: S3Repository -> Text
name} -> Text
name) (\s :: S3Repository
s@S3Repository' {} Text
a -> S3Repository
s {$sel:name:S3Repository' :: Text
name = Text
a} :: S3Repository)
s3Repository_bucketName :: Lens.Lens' S3Repository Prelude.Text
s3Repository_bucketName :: (Text -> f Text) -> S3Repository -> f S3Repository
s3Repository_bucketName = (S3Repository -> Text)
-> (S3Repository -> Text -> S3Repository)
-> Lens S3Repository S3Repository Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Repository' {Text
bucketName :: Text
$sel:bucketName:S3Repository' :: S3Repository -> Text
bucketName} -> Text
bucketName) (\s :: S3Repository
s@S3Repository' {} Text
a -> S3Repository
s {$sel:bucketName:S3Repository' :: Text
bucketName = Text
a} :: S3Repository)
instance Prelude.Hashable S3Repository
instance Prelude.NFData S3Repository
instance Core.ToJSON S3Repository where
toJSON :: S3Repository -> Value
toJSON S3Repository' {Text
bucketName :: Text
name :: Text
$sel:bucketName:S3Repository' :: S3Repository -> Text
$sel:name:S3Repository' :: S3Repository -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucketName)
]
)