{-# 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.BranchDiffSourceCodeType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BranchDiffSourceCodeType = BranchDiffSourceCodeType'
{
BranchDiffSourceCodeType -> Text
sourceBranchName :: Prelude.Text,
BranchDiffSourceCodeType -> Text
destinationBranchName :: Prelude.Text
}
deriving (BranchDiffSourceCodeType -> BranchDiffSourceCodeType -> Bool
(BranchDiffSourceCodeType -> BranchDiffSourceCodeType -> Bool)
-> (BranchDiffSourceCodeType -> BranchDiffSourceCodeType -> Bool)
-> Eq BranchDiffSourceCodeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BranchDiffSourceCodeType -> BranchDiffSourceCodeType -> Bool
$c/= :: BranchDiffSourceCodeType -> BranchDiffSourceCodeType -> Bool
== :: BranchDiffSourceCodeType -> BranchDiffSourceCodeType -> Bool
$c== :: BranchDiffSourceCodeType -> BranchDiffSourceCodeType -> Bool
Prelude.Eq, ReadPrec [BranchDiffSourceCodeType]
ReadPrec BranchDiffSourceCodeType
Int -> ReadS BranchDiffSourceCodeType
ReadS [BranchDiffSourceCodeType]
(Int -> ReadS BranchDiffSourceCodeType)
-> ReadS [BranchDiffSourceCodeType]
-> ReadPrec BranchDiffSourceCodeType
-> ReadPrec [BranchDiffSourceCodeType]
-> Read BranchDiffSourceCodeType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BranchDiffSourceCodeType]
$creadListPrec :: ReadPrec [BranchDiffSourceCodeType]
readPrec :: ReadPrec BranchDiffSourceCodeType
$creadPrec :: ReadPrec BranchDiffSourceCodeType
readList :: ReadS [BranchDiffSourceCodeType]
$creadList :: ReadS [BranchDiffSourceCodeType]
readsPrec :: Int -> ReadS BranchDiffSourceCodeType
$creadsPrec :: Int -> ReadS BranchDiffSourceCodeType
Prelude.Read, Int -> BranchDiffSourceCodeType -> ShowS
[BranchDiffSourceCodeType] -> ShowS
BranchDiffSourceCodeType -> String
(Int -> BranchDiffSourceCodeType -> ShowS)
-> (BranchDiffSourceCodeType -> String)
-> ([BranchDiffSourceCodeType] -> ShowS)
-> Show BranchDiffSourceCodeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BranchDiffSourceCodeType] -> ShowS
$cshowList :: [BranchDiffSourceCodeType] -> ShowS
show :: BranchDiffSourceCodeType -> String
$cshow :: BranchDiffSourceCodeType -> String
showsPrec :: Int -> BranchDiffSourceCodeType -> ShowS
$cshowsPrec :: Int -> BranchDiffSourceCodeType -> ShowS
Prelude.Show, (forall x.
BranchDiffSourceCodeType -> Rep BranchDiffSourceCodeType x)
-> (forall x.
Rep BranchDiffSourceCodeType x -> BranchDiffSourceCodeType)
-> Generic BranchDiffSourceCodeType
forall x.
Rep BranchDiffSourceCodeType x -> BranchDiffSourceCodeType
forall x.
BranchDiffSourceCodeType -> Rep BranchDiffSourceCodeType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BranchDiffSourceCodeType x -> BranchDiffSourceCodeType
$cfrom :: forall x.
BranchDiffSourceCodeType -> Rep BranchDiffSourceCodeType x
Prelude.Generic)
newBranchDiffSourceCodeType ::
Prelude.Text ->
Prelude.Text ->
BranchDiffSourceCodeType
newBranchDiffSourceCodeType :: Text -> Text -> BranchDiffSourceCodeType
newBranchDiffSourceCodeType
Text
pSourceBranchName_
Text
pDestinationBranchName_ =
BranchDiffSourceCodeType' :: Text -> Text -> BranchDiffSourceCodeType
BranchDiffSourceCodeType'
{ $sel:sourceBranchName:BranchDiffSourceCodeType' :: Text
sourceBranchName =
Text
pSourceBranchName_,
$sel:destinationBranchName:BranchDiffSourceCodeType' :: Text
destinationBranchName = Text
pDestinationBranchName_
}
branchDiffSourceCodeType_sourceBranchName :: Lens.Lens' BranchDiffSourceCodeType Prelude.Text
branchDiffSourceCodeType_sourceBranchName :: (Text -> f Text)
-> BranchDiffSourceCodeType -> f BranchDiffSourceCodeType
branchDiffSourceCodeType_sourceBranchName = (BranchDiffSourceCodeType -> Text)
-> (BranchDiffSourceCodeType -> Text -> BranchDiffSourceCodeType)
-> Lens BranchDiffSourceCodeType BranchDiffSourceCodeType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BranchDiffSourceCodeType' {Text
sourceBranchName :: Text
$sel:sourceBranchName:BranchDiffSourceCodeType' :: BranchDiffSourceCodeType -> Text
sourceBranchName} -> Text
sourceBranchName) (\s :: BranchDiffSourceCodeType
s@BranchDiffSourceCodeType' {} Text
a -> BranchDiffSourceCodeType
s {$sel:sourceBranchName:BranchDiffSourceCodeType' :: Text
sourceBranchName = Text
a} :: BranchDiffSourceCodeType)
branchDiffSourceCodeType_destinationBranchName :: Lens.Lens' BranchDiffSourceCodeType Prelude.Text
branchDiffSourceCodeType_destinationBranchName :: (Text -> f Text)
-> BranchDiffSourceCodeType -> f BranchDiffSourceCodeType
branchDiffSourceCodeType_destinationBranchName = (BranchDiffSourceCodeType -> Text)
-> (BranchDiffSourceCodeType -> Text -> BranchDiffSourceCodeType)
-> Lens BranchDiffSourceCodeType BranchDiffSourceCodeType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BranchDiffSourceCodeType' {Text
destinationBranchName :: Text
$sel:destinationBranchName:BranchDiffSourceCodeType' :: BranchDiffSourceCodeType -> Text
destinationBranchName} -> Text
destinationBranchName) (\s :: BranchDiffSourceCodeType
s@BranchDiffSourceCodeType' {} Text
a -> BranchDiffSourceCodeType
s {$sel:destinationBranchName:BranchDiffSourceCodeType' :: Text
destinationBranchName = Text
a} :: BranchDiffSourceCodeType)
instance Core.FromJSON BranchDiffSourceCodeType where
parseJSON :: Value -> Parser BranchDiffSourceCodeType
parseJSON =
String
-> (Object -> Parser BranchDiffSourceCodeType)
-> Value
-> Parser BranchDiffSourceCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BranchDiffSourceCodeType"
( \Object
x ->
Text -> Text -> BranchDiffSourceCodeType
BranchDiffSourceCodeType'
(Text -> Text -> BranchDiffSourceCodeType)
-> Parser Text -> Parser (Text -> BranchDiffSourceCodeType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SourceBranchName")
Parser (Text -> BranchDiffSourceCodeType)
-> Parser Text -> Parser BranchDiffSourceCodeType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DestinationBranchName")
)
instance Prelude.Hashable BranchDiffSourceCodeType
instance Prelude.NFData BranchDiffSourceCodeType
instance Core.ToJSON BranchDiffSourceCodeType where
toJSON :: BranchDiffSourceCodeType -> Value
toJSON BranchDiffSourceCodeType' {Text
destinationBranchName :: Text
sourceBranchName :: Text
$sel:destinationBranchName:BranchDiffSourceCodeType' :: BranchDiffSourceCodeType -> Text
$sel:sourceBranchName:BranchDiffSourceCodeType' :: BranchDiffSourceCodeType -> 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
"SourceBranchName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceBranchName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DestinationBranchName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationBranchName
)
]
)