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