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