{-# 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.CodeCommit.Types.MergeHunkDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MergeHunkDetail = MergeHunkDetail'
{
MergeHunkDetail -> Maybe Int
startLine :: Prelude.Maybe Prelude.Int,
MergeHunkDetail -> Maybe Int
endLine :: Prelude.Maybe Prelude.Int,
MergeHunkDetail -> Maybe Text
hunkContent :: Prelude.Maybe Prelude.Text
}
deriving (MergeHunkDetail -> MergeHunkDetail -> Bool
(MergeHunkDetail -> MergeHunkDetail -> Bool)
-> (MergeHunkDetail -> MergeHunkDetail -> Bool)
-> Eq MergeHunkDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeHunkDetail -> MergeHunkDetail -> Bool
$c/= :: MergeHunkDetail -> MergeHunkDetail -> Bool
== :: MergeHunkDetail -> MergeHunkDetail -> Bool
$c== :: MergeHunkDetail -> MergeHunkDetail -> Bool
Prelude.Eq, ReadPrec [MergeHunkDetail]
ReadPrec MergeHunkDetail
Int -> ReadS MergeHunkDetail
ReadS [MergeHunkDetail]
(Int -> ReadS MergeHunkDetail)
-> ReadS [MergeHunkDetail]
-> ReadPrec MergeHunkDetail
-> ReadPrec [MergeHunkDetail]
-> Read MergeHunkDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergeHunkDetail]
$creadListPrec :: ReadPrec [MergeHunkDetail]
readPrec :: ReadPrec MergeHunkDetail
$creadPrec :: ReadPrec MergeHunkDetail
readList :: ReadS [MergeHunkDetail]
$creadList :: ReadS [MergeHunkDetail]
readsPrec :: Int -> ReadS MergeHunkDetail
$creadsPrec :: Int -> ReadS MergeHunkDetail
Prelude.Read, Int -> MergeHunkDetail -> ShowS
[MergeHunkDetail] -> ShowS
MergeHunkDetail -> String
(Int -> MergeHunkDetail -> ShowS)
-> (MergeHunkDetail -> String)
-> ([MergeHunkDetail] -> ShowS)
-> Show MergeHunkDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeHunkDetail] -> ShowS
$cshowList :: [MergeHunkDetail] -> ShowS
show :: MergeHunkDetail -> String
$cshow :: MergeHunkDetail -> String
showsPrec :: Int -> MergeHunkDetail -> ShowS
$cshowsPrec :: Int -> MergeHunkDetail -> ShowS
Prelude.Show, (forall x. MergeHunkDetail -> Rep MergeHunkDetail x)
-> (forall x. Rep MergeHunkDetail x -> MergeHunkDetail)
-> Generic MergeHunkDetail
forall x. Rep MergeHunkDetail x -> MergeHunkDetail
forall x. MergeHunkDetail -> Rep MergeHunkDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MergeHunkDetail x -> MergeHunkDetail
$cfrom :: forall x. MergeHunkDetail -> Rep MergeHunkDetail x
Prelude.Generic)
newMergeHunkDetail ::
MergeHunkDetail
newMergeHunkDetail :: MergeHunkDetail
newMergeHunkDetail =
MergeHunkDetail' :: Maybe Int -> Maybe Int -> Maybe Text -> MergeHunkDetail
MergeHunkDetail'
{ $sel:startLine:MergeHunkDetail' :: Maybe Int
startLine = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:endLine:MergeHunkDetail' :: Maybe Int
endLine = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:hunkContent:MergeHunkDetail' :: Maybe Text
hunkContent = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
mergeHunkDetail_startLine :: Lens.Lens' MergeHunkDetail (Prelude.Maybe Prelude.Int)
mergeHunkDetail_startLine :: (Maybe Int -> f (Maybe Int))
-> MergeHunkDetail -> f MergeHunkDetail
mergeHunkDetail_startLine = (MergeHunkDetail -> Maybe Int)
-> (MergeHunkDetail -> Maybe Int -> MergeHunkDetail)
-> Lens MergeHunkDetail MergeHunkDetail (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeHunkDetail' {Maybe Int
startLine :: Maybe Int
$sel:startLine:MergeHunkDetail' :: MergeHunkDetail -> Maybe Int
startLine} -> Maybe Int
startLine) (\s :: MergeHunkDetail
s@MergeHunkDetail' {} Maybe Int
a -> MergeHunkDetail
s {$sel:startLine:MergeHunkDetail' :: Maybe Int
startLine = Maybe Int
a} :: MergeHunkDetail)
mergeHunkDetail_endLine :: Lens.Lens' MergeHunkDetail (Prelude.Maybe Prelude.Int)
mergeHunkDetail_endLine :: (Maybe Int -> f (Maybe Int))
-> MergeHunkDetail -> f MergeHunkDetail
mergeHunkDetail_endLine = (MergeHunkDetail -> Maybe Int)
-> (MergeHunkDetail -> Maybe Int -> MergeHunkDetail)
-> Lens MergeHunkDetail MergeHunkDetail (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeHunkDetail' {Maybe Int
endLine :: Maybe Int
$sel:endLine:MergeHunkDetail' :: MergeHunkDetail -> Maybe Int
endLine} -> Maybe Int
endLine) (\s :: MergeHunkDetail
s@MergeHunkDetail' {} Maybe Int
a -> MergeHunkDetail
s {$sel:endLine:MergeHunkDetail' :: Maybe Int
endLine = Maybe Int
a} :: MergeHunkDetail)
mergeHunkDetail_hunkContent :: Lens.Lens' MergeHunkDetail (Prelude.Maybe Prelude.Text)
mergeHunkDetail_hunkContent :: (Maybe Text -> f (Maybe Text))
-> MergeHunkDetail -> f MergeHunkDetail
mergeHunkDetail_hunkContent = (MergeHunkDetail -> Maybe Text)
-> (MergeHunkDetail -> Maybe Text -> MergeHunkDetail)
-> Lens MergeHunkDetail MergeHunkDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeHunkDetail' {Maybe Text
hunkContent :: Maybe Text
$sel:hunkContent:MergeHunkDetail' :: MergeHunkDetail -> Maybe Text
hunkContent} -> Maybe Text
hunkContent) (\s :: MergeHunkDetail
s@MergeHunkDetail' {} Maybe Text
a -> MergeHunkDetail
s {$sel:hunkContent:MergeHunkDetail' :: Maybe Text
hunkContent = Maybe Text
a} :: MergeHunkDetail)
instance Core.FromJSON MergeHunkDetail where
parseJSON :: Value -> Parser MergeHunkDetail
parseJSON =
String
-> (Object -> Parser MergeHunkDetail)
-> Value
-> Parser MergeHunkDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MergeHunkDetail"
( \Object
x ->
Maybe Int -> Maybe Int -> Maybe Text -> MergeHunkDetail
MergeHunkDetail'
(Maybe Int -> Maybe Int -> Maybe Text -> MergeHunkDetail)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Text -> MergeHunkDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startLine")
Parser (Maybe Int -> Maybe Text -> MergeHunkDetail)
-> Parser (Maybe Int) -> Parser (Maybe Text -> MergeHunkDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"endLine")
Parser (Maybe Text -> MergeHunkDetail)
-> Parser (Maybe Text) -> Parser MergeHunkDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hunkContent")
)
instance Prelude.Hashable MergeHunkDetail
instance Prelude.NFData MergeHunkDetail