{-# 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.Commit where
import Amazonka.CodeCommit.Types.UserInfo
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Commit = Commit'
{
Commit -> Maybe Text
additionalData :: Prelude.Maybe Prelude.Text,
Commit -> Maybe UserInfo
author :: Prelude.Maybe UserInfo,
Commit -> Maybe Text
commitId :: Prelude.Maybe Prelude.Text,
Commit -> Maybe UserInfo
committer :: Prelude.Maybe UserInfo,
Commit -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
Commit -> Maybe [Text]
parents :: Prelude.Maybe [Prelude.Text],
Commit -> Maybe Text
treeId :: Prelude.Maybe Prelude.Text
}
deriving (Commit -> Commit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Commit -> Commit -> Bool
$c/= :: Commit -> Commit -> Bool
== :: Commit -> Commit -> Bool
$c== :: Commit -> Commit -> Bool
Prelude.Eq, ReadPrec [Commit]
ReadPrec Commit
Int -> ReadS Commit
ReadS [Commit]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Commit]
$creadListPrec :: ReadPrec [Commit]
readPrec :: ReadPrec Commit
$creadPrec :: ReadPrec Commit
readList :: ReadS [Commit]
$creadList :: ReadS [Commit]
readsPrec :: Int -> ReadS Commit
$creadsPrec :: Int -> ReadS Commit
Prelude.Read, Int -> Commit -> ShowS
[Commit] -> ShowS
Commit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Commit] -> ShowS
$cshowList :: [Commit] -> ShowS
show :: Commit -> String
$cshow :: Commit -> String
showsPrec :: Int -> Commit -> ShowS
$cshowsPrec :: Int -> Commit -> ShowS
Prelude.Show, forall x. Rep Commit x -> Commit
forall x. Commit -> Rep Commit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Commit x -> Commit
$cfrom :: forall x. Commit -> Rep Commit x
Prelude.Generic)
newCommit ::
Commit
newCommit :: Commit
newCommit =
Commit'
{ $sel:additionalData:Commit' :: Maybe Text
additionalData = forall a. Maybe a
Prelude.Nothing,
$sel:author:Commit' :: Maybe UserInfo
author = forall a. Maybe a
Prelude.Nothing,
$sel:commitId:Commit' :: Maybe Text
commitId = forall a. Maybe a
Prelude.Nothing,
$sel:committer:Commit' :: Maybe UserInfo
committer = forall a. Maybe a
Prelude.Nothing,
$sel:message:Commit' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
$sel:parents:Commit' :: Maybe [Text]
parents = forall a. Maybe a
Prelude.Nothing,
$sel:treeId:Commit' :: Maybe Text
treeId = forall a. Maybe a
Prelude.Nothing
}
commit_additionalData :: Lens.Lens' Commit (Prelude.Maybe Prelude.Text)
commit_additionalData :: Lens' Commit (Maybe Text)
commit_additionalData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Commit' {Maybe Text
additionalData :: Maybe Text
$sel:additionalData:Commit' :: Commit -> Maybe Text
additionalData} -> Maybe Text
additionalData) (\s :: Commit
s@Commit' {} Maybe Text
a -> Commit
s {$sel:additionalData:Commit' :: Maybe Text
additionalData = Maybe Text
a} :: Commit)
commit_author :: Lens.Lens' Commit (Prelude.Maybe UserInfo)
commit_author :: Lens' Commit (Maybe UserInfo)
commit_author = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Commit' {Maybe UserInfo
author :: Maybe UserInfo
$sel:author:Commit' :: Commit -> Maybe UserInfo
author} -> Maybe UserInfo
author) (\s :: Commit
s@Commit' {} Maybe UserInfo
a -> Commit
s {$sel:author:Commit' :: Maybe UserInfo
author = Maybe UserInfo
a} :: Commit)
commit_commitId :: Lens.Lens' Commit (Prelude.Maybe Prelude.Text)
commit_commitId :: Lens' Commit (Maybe Text)
commit_commitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Commit' {Maybe Text
commitId :: Maybe Text
$sel:commitId:Commit' :: Commit -> Maybe Text
commitId} -> Maybe Text
commitId) (\s :: Commit
s@Commit' {} Maybe Text
a -> Commit
s {$sel:commitId:Commit' :: Maybe Text
commitId = Maybe Text
a} :: Commit)
commit_committer :: Lens.Lens' Commit (Prelude.Maybe UserInfo)
commit_committer :: Lens' Commit (Maybe UserInfo)
commit_committer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Commit' {Maybe UserInfo
committer :: Maybe UserInfo
$sel:committer:Commit' :: Commit -> Maybe UserInfo
committer} -> Maybe UserInfo
committer) (\s :: Commit
s@Commit' {} Maybe UserInfo
a -> Commit
s {$sel:committer:Commit' :: Maybe UserInfo
committer = Maybe UserInfo
a} :: Commit)
commit_message :: Lens.Lens' Commit (Prelude.Maybe Prelude.Text)
commit_message :: Lens' Commit (Maybe Text)
commit_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Commit' {Maybe Text
message :: Maybe Text
$sel:message:Commit' :: Commit -> Maybe Text
message} -> Maybe Text
message) (\s :: Commit
s@Commit' {} Maybe Text
a -> Commit
s {$sel:message:Commit' :: Maybe Text
message = Maybe Text
a} :: Commit)
commit_parents :: Lens.Lens' Commit (Prelude.Maybe [Prelude.Text])
commit_parents :: Lens' Commit (Maybe [Text])
commit_parents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Commit' {Maybe [Text]
parents :: Maybe [Text]
$sel:parents:Commit' :: Commit -> Maybe [Text]
parents} -> Maybe [Text]
parents) (\s :: Commit
s@Commit' {} Maybe [Text]
a -> Commit
s {$sel:parents:Commit' :: Maybe [Text]
parents = Maybe [Text]
a} :: Commit) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
commit_treeId :: Lens.Lens' Commit (Prelude.Maybe Prelude.Text)
commit_treeId :: Lens' Commit (Maybe Text)
commit_treeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Commit' {Maybe Text
treeId :: Maybe Text
$sel:treeId:Commit' :: Commit -> Maybe Text
treeId} -> Maybe Text
treeId) (\s :: Commit
s@Commit' {} Maybe Text
a -> Commit
s {$sel:treeId:Commit' :: Maybe Text
treeId = Maybe Text
a} :: Commit)
instance Data.FromJSON Commit where
parseJSON :: Value -> Parser Commit
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Commit"
( \Object
x ->
Maybe Text
-> Maybe UserInfo
-> Maybe Text
-> Maybe UserInfo
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Commit
Commit'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"additionalData")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"author")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"commitId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"committer")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"message")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"parents" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"treeId")
)
instance Prelude.Hashable Commit where
hashWithSalt :: Int -> Commit -> Int
hashWithSalt Int
_salt Commit' {Maybe [Text]
Maybe Text
Maybe UserInfo
treeId :: Maybe Text
parents :: Maybe [Text]
message :: Maybe Text
committer :: Maybe UserInfo
commitId :: Maybe Text
author :: Maybe UserInfo
additionalData :: Maybe Text
$sel:treeId:Commit' :: Commit -> Maybe Text
$sel:parents:Commit' :: Commit -> Maybe [Text]
$sel:message:Commit' :: Commit -> Maybe Text
$sel:committer:Commit' :: Commit -> Maybe UserInfo
$sel:commitId:Commit' :: Commit -> Maybe Text
$sel:author:Commit' :: Commit -> Maybe UserInfo
$sel:additionalData:Commit' :: Commit -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
additionalData
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserInfo
author
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
commitId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserInfo
committer
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
parents
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
treeId
instance Prelude.NFData Commit where
rnf :: Commit -> ()
rnf Commit' {Maybe [Text]
Maybe Text
Maybe UserInfo
treeId :: Maybe Text
parents :: Maybe [Text]
message :: Maybe Text
committer :: Maybe UserInfo
commitId :: Maybe Text
author :: Maybe UserInfo
additionalData :: Maybe Text
$sel:treeId:Commit' :: Commit -> Maybe Text
$sel:parents:Commit' :: Commit -> Maybe [Text]
$sel:message:Commit' :: Commit -> Maybe Text
$sel:committer:Commit' :: Commit -> Maybe UserInfo
$sel:commitId:Commit' :: Commit -> Maybe Text
$sel:author:Commit' :: Commit -> Maybe UserInfo
$sel:additionalData:Commit' :: Commit -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
additionalData
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserInfo
author
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
commitId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserInfo
committer
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
parents
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
treeId