{-# 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.Conflict where
import Amazonka.CodeCommit.Types.ConflictMetadata
import Amazonka.CodeCommit.Types.MergeHunk
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Conflict = Conflict'
{
Conflict -> Maybe [MergeHunk]
mergeHunks :: Prelude.Maybe [MergeHunk],
Conflict -> Maybe ConflictMetadata
conflictMetadata :: Prelude.Maybe ConflictMetadata
}
deriving (Conflict -> Conflict -> Bool
(Conflict -> Conflict -> Bool)
-> (Conflict -> Conflict -> Bool) -> Eq Conflict
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Conflict -> Conflict -> Bool
$c/= :: Conflict -> Conflict -> Bool
== :: Conflict -> Conflict -> Bool
$c== :: Conflict -> Conflict -> Bool
Prelude.Eq, ReadPrec [Conflict]
ReadPrec Conflict
Int -> ReadS Conflict
ReadS [Conflict]
(Int -> ReadS Conflict)
-> ReadS [Conflict]
-> ReadPrec Conflict
-> ReadPrec [Conflict]
-> Read Conflict
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Conflict]
$creadListPrec :: ReadPrec [Conflict]
readPrec :: ReadPrec Conflict
$creadPrec :: ReadPrec Conflict
readList :: ReadS [Conflict]
$creadList :: ReadS [Conflict]
readsPrec :: Int -> ReadS Conflict
$creadsPrec :: Int -> ReadS Conflict
Prelude.Read, Int -> Conflict -> ShowS
[Conflict] -> ShowS
Conflict -> String
(Int -> Conflict -> ShowS)
-> (Conflict -> String) -> ([Conflict] -> ShowS) -> Show Conflict
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Conflict] -> ShowS
$cshowList :: [Conflict] -> ShowS
show :: Conflict -> String
$cshow :: Conflict -> String
showsPrec :: Int -> Conflict -> ShowS
$cshowsPrec :: Int -> Conflict -> ShowS
Prelude.Show, (forall x. Conflict -> Rep Conflict x)
-> (forall x. Rep Conflict x -> Conflict) -> Generic Conflict
forall x. Rep Conflict x -> Conflict
forall x. Conflict -> Rep Conflict x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Conflict x -> Conflict
$cfrom :: forall x. Conflict -> Rep Conflict x
Prelude.Generic)
newConflict ::
Conflict
newConflict :: Conflict
newConflict =
Conflict' :: Maybe [MergeHunk] -> Maybe ConflictMetadata -> Conflict
Conflict'
{ $sel:mergeHunks:Conflict' :: Maybe [MergeHunk]
mergeHunks = Maybe [MergeHunk]
forall a. Maybe a
Prelude.Nothing,
$sel:conflictMetadata:Conflict' :: Maybe ConflictMetadata
conflictMetadata = Maybe ConflictMetadata
forall a. Maybe a
Prelude.Nothing
}
conflict_mergeHunks :: Lens.Lens' Conflict (Prelude.Maybe [MergeHunk])
conflict_mergeHunks :: (Maybe [MergeHunk] -> f (Maybe [MergeHunk]))
-> Conflict -> f Conflict
conflict_mergeHunks = (Conflict -> Maybe [MergeHunk])
-> (Conflict -> Maybe [MergeHunk] -> Conflict)
-> Lens Conflict Conflict (Maybe [MergeHunk]) (Maybe [MergeHunk])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Conflict' {Maybe [MergeHunk]
mergeHunks :: Maybe [MergeHunk]
$sel:mergeHunks:Conflict' :: Conflict -> Maybe [MergeHunk]
mergeHunks} -> Maybe [MergeHunk]
mergeHunks) (\s :: Conflict
s@Conflict' {} Maybe [MergeHunk]
a -> Conflict
s {$sel:mergeHunks:Conflict' :: Maybe [MergeHunk]
mergeHunks = Maybe [MergeHunk]
a} :: Conflict) ((Maybe [MergeHunk] -> f (Maybe [MergeHunk]))
-> Conflict -> f Conflict)
-> ((Maybe [MergeHunk] -> f (Maybe [MergeHunk]))
-> Maybe [MergeHunk] -> f (Maybe [MergeHunk]))
-> (Maybe [MergeHunk] -> f (Maybe [MergeHunk]))
-> Conflict
-> f Conflict
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MergeHunk] [MergeHunk] [MergeHunk] [MergeHunk]
-> Iso
(Maybe [MergeHunk])
(Maybe [MergeHunk])
(Maybe [MergeHunk])
(Maybe [MergeHunk])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [MergeHunk] [MergeHunk] [MergeHunk] [MergeHunk]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
conflict_conflictMetadata :: Lens.Lens' Conflict (Prelude.Maybe ConflictMetadata)
conflict_conflictMetadata :: (Maybe ConflictMetadata -> f (Maybe ConflictMetadata))
-> Conflict -> f Conflict
conflict_conflictMetadata = (Conflict -> Maybe ConflictMetadata)
-> (Conflict -> Maybe ConflictMetadata -> Conflict)
-> Lens
Conflict Conflict (Maybe ConflictMetadata) (Maybe ConflictMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Conflict' {Maybe ConflictMetadata
conflictMetadata :: Maybe ConflictMetadata
$sel:conflictMetadata:Conflict' :: Conflict -> Maybe ConflictMetadata
conflictMetadata} -> Maybe ConflictMetadata
conflictMetadata) (\s :: Conflict
s@Conflict' {} Maybe ConflictMetadata
a -> Conflict
s {$sel:conflictMetadata:Conflict' :: Maybe ConflictMetadata
conflictMetadata = Maybe ConflictMetadata
a} :: Conflict)
instance Core.FromJSON Conflict where
parseJSON :: Value -> Parser Conflict
parseJSON =
String -> (Object -> Parser Conflict) -> Value -> Parser Conflict
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Conflict"
( \Object
x ->
Maybe [MergeHunk] -> Maybe ConflictMetadata -> Conflict
Conflict'
(Maybe [MergeHunk] -> Maybe ConflictMetadata -> Conflict)
-> Parser (Maybe [MergeHunk])
-> Parser (Maybe ConflictMetadata -> Conflict)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [MergeHunk]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mergeHunks" Parser (Maybe (Maybe [MergeHunk]))
-> Maybe [MergeHunk] -> Parser (Maybe [MergeHunk])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MergeHunk]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe ConflictMetadata -> Conflict)
-> Parser (Maybe ConflictMetadata) -> Parser Conflict
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConflictMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"conflictMetadata")
)
instance Prelude.Hashable Conflict
instance Prelude.NFData Conflict