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