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