{-# 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.CodeGuruReviewer.Types.RepositoryHeadSourceCodeType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RepositoryHeadSourceCodeType = RepositoryHeadSourceCodeType'
{
RepositoryHeadSourceCodeType -> Text
branchName :: Prelude.Text
}
deriving (RepositoryHeadSourceCodeType
-> RepositoryHeadSourceCodeType -> Bool
(RepositoryHeadSourceCodeType
-> RepositoryHeadSourceCodeType -> Bool)
-> (RepositoryHeadSourceCodeType
-> RepositoryHeadSourceCodeType -> Bool)
-> Eq RepositoryHeadSourceCodeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositoryHeadSourceCodeType
-> RepositoryHeadSourceCodeType -> Bool
$c/= :: RepositoryHeadSourceCodeType
-> RepositoryHeadSourceCodeType -> Bool
== :: RepositoryHeadSourceCodeType
-> RepositoryHeadSourceCodeType -> Bool
$c== :: RepositoryHeadSourceCodeType
-> RepositoryHeadSourceCodeType -> Bool
Prelude.Eq, ReadPrec [RepositoryHeadSourceCodeType]
ReadPrec RepositoryHeadSourceCodeType
Int -> ReadS RepositoryHeadSourceCodeType
ReadS [RepositoryHeadSourceCodeType]
(Int -> ReadS RepositoryHeadSourceCodeType)
-> ReadS [RepositoryHeadSourceCodeType]
-> ReadPrec RepositoryHeadSourceCodeType
-> ReadPrec [RepositoryHeadSourceCodeType]
-> Read RepositoryHeadSourceCodeType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositoryHeadSourceCodeType]
$creadListPrec :: ReadPrec [RepositoryHeadSourceCodeType]
readPrec :: ReadPrec RepositoryHeadSourceCodeType
$creadPrec :: ReadPrec RepositoryHeadSourceCodeType
readList :: ReadS [RepositoryHeadSourceCodeType]
$creadList :: ReadS [RepositoryHeadSourceCodeType]
readsPrec :: Int -> ReadS RepositoryHeadSourceCodeType
$creadsPrec :: Int -> ReadS RepositoryHeadSourceCodeType
Prelude.Read, Int -> RepositoryHeadSourceCodeType -> ShowS
[RepositoryHeadSourceCodeType] -> ShowS
RepositoryHeadSourceCodeType -> String
(Int -> RepositoryHeadSourceCodeType -> ShowS)
-> (RepositoryHeadSourceCodeType -> String)
-> ([RepositoryHeadSourceCodeType] -> ShowS)
-> Show RepositoryHeadSourceCodeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositoryHeadSourceCodeType] -> ShowS
$cshowList :: [RepositoryHeadSourceCodeType] -> ShowS
show :: RepositoryHeadSourceCodeType -> String
$cshow :: RepositoryHeadSourceCodeType -> String
showsPrec :: Int -> RepositoryHeadSourceCodeType -> ShowS
$cshowsPrec :: Int -> RepositoryHeadSourceCodeType -> ShowS
Prelude.Show, (forall x.
RepositoryHeadSourceCodeType -> Rep RepositoryHeadSourceCodeType x)
-> (forall x.
Rep RepositoryHeadSourceCodeType x -> RepositoryHeadSourceCodeType)
-> Generic RepositoryHeadSourceCodeType
forall x.
Rep RepositoryHeadSourceCodeType x -> RepositoryHeadSourceCodeType
forall x.
RepositoryHeadSourceCodeType -> Rep RepositoryHeadSourceCodeType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RepositoryHeadSourceCodeType x -> RepositoryHeadSourceCodeType
$cfrom :: forall x.
RepositoryHeadSourceCodeType -> Rep RepositoryHeadSourceCodeType x
Prelude.Generic)
newRepositoryHeadSourceCodeType ::
Prelude.Text ->
RepositoryHeadSourceCodeType
newRepositoryHeadSourceCodeType :: Text -> RepositoryHeadSourceCodeType
newRepositoryHeadSourceCodeType Text
pBranchName_ =
RepositoryHeadSourceCodeType' :: Text -> RepositoryHeadSourceCodeType
RepositoryHeadSourceCodeType'
{ $sel:branchName:RepositoryHeadSourceCodeType' :: Text
branchName =
Text
pBranchName_
}
repositoryHeadSourceCodeType_branchName :: Lens.Lens' RepositoryHeadSourceCodeType Prelude.Text
repositoryHeadSourceCodeType_branchName :: (Text -> f Text)
-> RepositoryHeadSourceCodeType -> f RepositoryHeadSourceCodeType
repositoryHeadSourceCodeType_branchName = (RepositoryHeadSourceCodeType -> Text)
-> (RepositoryHeadSourceCodeType
-> Text -> RepositoryHeadSourceCodeType)
-> Lens
RepositoryHeadSourceCodeType RepositoryHeadSourceCodeType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryHeadSourceCodeType' {Text
branchName :: Text
$sel:branchName:RepositoryHeadSourceCodeType' :: RepositoryHeadSourceCodeType -> Text
branchName} -> Text
branchName) (\s :: RepositoryHeadSourceCodeType
s@RepositoryHeadSourceCodeType' {} Text
a -> RepositoryHeadSourceCodeType
s {$sel:branchName:RepositoryHeadSourceCodeType' :: Text
branchName = Text
a} :: RepositoryHeadSourceCodeType)
instance Core.FromJSON RepositoryHeadSourceCodeType where
parseJSON :: Value -> Parser RepositoryHeadSourceCodeType
parseJSON =
String
-> (Object -> Parser RepositoryHeadSourceCodeType)
-> Value
-> Parser RepositoryHeadSourceCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RepositoryHeadSourceCodeType"
( \Object
x ->
Text -> RepositoryHeadSourceCodeType
RepositoryHeadSourceCodeType'
(Text -> RepositoryHeadSourceCodeType)
-> Parser Text -> Parser RepositoryHeadSourceCodeType
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BranchName")
)
instance
Prelude.Hashable
RepositoryHeadSourceCodeType
instance Prelude.NFData RepositoryHeadSourceCodeType
instance Core.ToJSON RepositoryHeadSourceCodeType where
toJSON :: RepositoryHeadSourceCodeType -> Value
toJSON RepositoryHeadSourceCodeType' {Text
branchName :: Text
$sel:branchName:RepositoryHeadSourceCodeType' :: RepositoryHeadSourceCodeType -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BranchName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
branchName)]
)