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