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