module Stratosphere.NotificationsContacts.EmailContact (
EmailContact(..), mkEmailContact
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data EmailContact
=
EmailContact {EmailContact -> ()
haddock_workaround_ :: (),
EmailContact -> Value Text
emailAddress :: (Value Prelude.Text),
EmailContact -> Value Text
name :: (Value Prelude.Text),
EmailContact -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (EmailContact -> EmailContact -> Bool
(EmailContact -> EmailContact -> Bool)
-> (EmailContact -> EmailContact -> Bool) -> Eq EmailContact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EmailContact -> EmailContact -> Bool
== :: EmailContact -> EmailContact -> Bool
$c/= :: EmailContact -> EmailContact -> Bool
/= :: EmailContact -> EmailContact -> Bool
Prelude.Eq, Int -> EmailContact -> ShowS
[EmailContact] -> ShowS
EmailContact -> String
(Int -> EmailContact -> ShowS)
-> (EmailContact -> String)
-> ([EmailContact] -> ShowS)
-> Show EmailContact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EmailContact -> ShowS
showsPrec :: Int -> EmailContact -> ShowS
$cshow :: EmailContact -> String
show :: EmailContact -> String
$cshowList :: [EmailContact] -> ShowS
showList :: [EmailContact] -> ShowS
Prelude.Show)
mkEmailContact ::
Value Prelude.Text -> Value Prelude.Text -> EmailContact
mkEmailContact :: Value Text -> Value Text -> EmailContact
mkEmailContact Value Text
emailAddress Value Text
name
= EmailContact
{haddock_workaround_ :: ()
haddock_workaround_ = (), emailAddress :: Value Text
emailAddress = Value Text
emailAddress,
name :: Value Text
name = Value Text
name, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties EmailContact where
toResourceProperties :: EmailContact -> ResourceProperties
toResourceProperties EmailContact {Maybe [Tag]
()
Value Text
haddock_workaround_ :: EmailContact -> ()
emailAddress :: EmailContact -> Value Text
name :: EmailContact -> Value Text
tags :: EmailContact -> Maybe [Tag]
haddock_workaround_ :: ()
emailAddress :: Value Text
name :: Value Text
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::NotificationsContacts::EmailContact",
supportsTags :: Bool
supportsTags = Bool
Prelude.True,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"EmailAddress" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
emailAddress, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON EmailContact where
toJSON :: EmailContact -> Value
toJSON EmailContact {Maybe [Tag]
()
Value Text
haddock_workaround_ :: EmailContact -> ()
emailAddress :: EmailContact -> Value Text
name :: EmailContact -> Value Text
tags :: EmailContact -> Maybe [Tag]
haddock_workaround_ :: ()
emailAddress :: Value Text
name :: Value Text
tags :: Maybe [Tag]
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"EmailAddress" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
emailAddress, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "EmailAddress" EmailContact where
type PropertyType "EmailAddress" EmailContact = Value Prelude.Text
set :: PropertyType "EmailAddress" EmailContact
-> EmailContact -> EmailContact
set PropertyType "EmailAddress" EmailContact
newValue EmailContact {Maybe [Tag]
()
Value Text
haddock_workaround_ :: EmailContact -> ()
emailAddress :: EmailContact -> Value Text
name :: EmailContact -> Value Text
tags :: EmailContact -> Maybe [Tag]
haddock_workaround_ :: ()
emailAddress :: Value Text
name :: Value Text
tags :: Maybe [Tag]
..}
= EmailContact {emailAddress :: Value Text
emailAddress = PropertyType "EmailAddress" EmailContact
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Name" EmailContact where
type PropertyType "Name" EmailContact = Value Prelude.Text
set :: PropertyType "Name" EmailContact -> EmailContact -> EmailContact
set PropertyType "Name" EmailContact
newValue EmailContact {Maybe [Tag]
()
Value Text
haddock_workaround_ :: EmailContact -> ()
emailAddress :: EmailContact -> Value Text
name :: EmailContact -> Value Text
tags :: EmailContact -> Maybe [Tag]
haddock_workaround_ :: ()
emailAddress :: Value Text
name :: Value Text
tags :: Maybe [Tag]
..} = EmailContact {name :: Value Text
name = PropertyType "Name" EmailContact
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
emailAddress :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
emailAddress :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" EmailContact where
type PropertyType "Tags" EmailContact = [Tag]
set :: PropertyType "Tags" EmailContact -> EmailContact -> EmailContact
set PropertyType "Tags" EmailContact
newValue EmailContact {Maybe [Tag]
()
Value Text
haddock_workaround_ :: EmailContact -> ()
emailAddress :: EmailContact -> Value Text
name :: EmailContact -> Value Text
tags :: EmailContact -> Maybe [Tag]
haddock_workaround_ :: ()
emailAddress :: Value Text
name :: Value Text
tags :: Maybe [Tag]
..}
= EmailContact {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" EmailContact
newValue, ()
Value Text
haddock_workaround_ :: ()
emailAddress :: Value Text
name :: Value Text
haddock_workaround_ :: ()
emailAddress :: Value Text
name :: Value Text
..}