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