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