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