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