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