{-# 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.ContactChannel where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMContacts.Types.ActivationStatus
import Amazonka.SSMContacts.Types.ChannelType
import Amazonka.SSMContacts.Types.ContactChannelAddress
data ContactChannel = ContactChannel'
{
ContactChannel -> Maybe ChannelType
type' :: Prelude.Maybe ChannelType,
ContactChannel -> Text
contactChannelArn :: Prelude.Text,
ContactChannel -> Text
contactArn :: Prelude.Text,
ContactChannel -> Text
name :: Prelude.Text,
ContactChannel -> ContactChannelAddress
deliveryAddress :: ContactChannelAddress,
ContactChannel -> ActivationStatus
activationStatus :: ActivationStatus
}
deriving (ContactChannel -> ContactChannel -> Bool
(ContactChannel -> ContactChannel -> Bool)
-> (ContactChannel -> ContactChannel -> Bool) -> Eq ContactChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContactChannel -> ContactChannel -> Bool
$c/= :: ContactChannel -> ContactChannel -> Bool
== :: ContactChannel -> ContactChannel -> Bool
$c== :: ContactChannel -> ContactChannel -> Bool
Prelude.Eq, ReadPrec [ContactChannel]
ReadPrec ContactChannel
Int -> ReadS ContactChannel
ReadS [ContactChannel]
(Int -> ReadS ContactChannel)
-> ReadS [ContactChannel]
-> ReadPrec ContactChannel
-> ReadPrec [ContactChannel]
-> Read ContactChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContactChannel]
$creadListPrec :: ReadPrec [ContactChannel]
readPrec :: ReadPrec ContactChannel
$creadPrec :: ReadPrec ContactChannel
readList :: ReadS [ContactChannel]
$creadList :: ReadS [ContactChannel]
readsPrec :: Int -> ReadS ContactChannel
$creadsPrec :: Int -> ReadS ContactChannel
Prelude.Read, Int -> ContactChannel -> ShowS
[ContactChannel] -> ShowS
ContactChannel -> String
(Int -> ContactChannel -> ShowS)
-> (ContactChannel -> String)
-> ([ContactChannel] -> ShowS)
-> Show ContactChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContactChannel] -> ShowS
$cshowList :: [ContactChannel] -> ShowS
show :: ContactChannel -> String
$cshow :: ContactChannel -> String
showsPrec :: Int -> ContactChannel -> ShowS
$cshowsPrec :: Int -> ContactChannel -> ShowS
Prelude.Show, (forall x. ContactChannel -> Rep ContactChannel x)
-> (forall x. Rep ContactChannel x -> ContactChannel)
-> Generic ContactChannel
forall x. Rep ContactChannel x -> ContactChannel
forall x. ContactChannel -> Rep ContactChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContactChannel x -> ContactChannel
$cfrom :: forall x. ContactChannel -> Rep ContactChannel x
Prelude.Generic)
newContactChannel ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ContactChannelAddress ->
ActivationStatus ->
ContactChannel
newContactChannel :: Text
-> Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel
newContactChannel
Text
pContactChannelArn_
Text
pContactArn_
Text
pName_
ContactChannelAddress
pDeliveryAddress_
ActivationStatus
pActivationStatus_ =
ContactChannel' :: Maybe ChannelType
-> Text
-> Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel
ContactChannel'
{ $sel:type':ContactChannel' :: Maybe ChannelType
type' = Maybe ChannelType
forall a. Maybe a
Prelude.Nothing,
$sel:contactChannelArn:ContactChannel' :: Text
contactChannelArn = Text
pContactChannelArn_,
$sel:contactArn:ContactChannel' :: Text
contactArn = Text
pContactArn_,
$sel:name:ContactChannel' :: Text
name = Text
pName_,
$sel:deliveryAddress:ContactChannel' :: ContactChannelAddress
deliveryAddress = ContactChannelAddress
pDeliveryAddress_,
$sel:activationStatus:ContactChannel' :: ActivationStatus
activationStatus = ActivationStatus
pActivationStatus_
}
contactChannel_type :: Lens.Lens' ContactChannel (Prelude.Maybe ChannelType)
contactChannel_type :: (Maybe ChannelType -> f (Maybe ChannelType))
-> ContactChannel -> f ContactChannel
contactChannel_type = (ContactChannel -> Maybe ChannelType)
-> (ContactChannel -> Maybe ChannelType -> ContactChannel)
-> Lens
ContactChannel
ContactChannel
(Maybe ChannelType)
(Maybe ChannelType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactChannel' {Maybe ChannelType
type' :: Maybe ChannelType
$sel:type':ContactChannel' :: ContactChannel -> Maybe ChannelType
type'} -> Maybe ChannelType
type') (\s :: ContactChannel
s@ContactChannel' {} Maybe ChannelType
a -> ContactChannel
s {$sel:type':ContactChannel' :: Maybe ChannelType
type' = Maybe ChannelType
a} :: ContactChannel)
contactChannel_contactChannelArn :: Lens.Lens' ContactChannel Prelude.Text
contactChannel_contactChannelArn :: (Text -> f Text) -> ContactChannel -> f ContactChannel
contactChannel_contactChannelArn = (ContactChannel -> Text)
-> (ContactChannel -> Text -> ContactChannel)
-> Lens ContactChannel ContactChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactChannel' {Text
contactChannelArn :: Text
$sel:contactChannelArn:ContactChannel' :: ContactChannel -> Text
contactChannelArn} -> Text
contactChannelArn) (\s :: ContactChannel
s@ContactChannel' {} Text
a -> ContactChannel
s {$sel:contactChannelArn:ContactChannel' :: Text
contactChannelArn = Text
a} :: ContactChannel)
contactChannel_contactArn :: Lens.Lens' ContactChannel Prelude.Text
contactChannel_contactArn :: (Text -> f Text) -> ContactChannel -> f ContactChannel
contactChannel_contactArn = (ContactChannel -> Text)
-> (ContactChannel -> Text -> ContactChannel)
-> Lens ContactChannel ContactChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactChannel' {Text
contactArn :: Text
$sel:contactArn:ContactChannel' :: ContactChannel -> Text
contactArn} -> Text
contactArn) (\s :: ContactChannel
s@ContactChannel' {} Text
a -> ContactChannel
s {$sel:contactArn:ContactChannel' :: Text
contactArn = Text
a} :: ContactChannel)
contactChannel_name :: Lens.Lens' ContactChannel Prelude.Text
contactChannel_name :: (Text -> f Text) -> ContactChannel -> f ContactChannel
contactChannel_name = (ContactChannel -> Text)
-> (ContactChannel -> Text -> ContactChannel)
-> Lens ContactChannel ContactChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactChannel' {Text
name :: Text
$sel:name:ContactChannel' :: ContactChannel -> Text
name} -> Text
name) (\s :: ContactChannel
s@ContactChannel' {} Text
a -> ContactChannel
s {$sel:name:ContactChannel' :: Text
name = Text
a} :: ContactChannel)
contactChannel_deliveryAddress :: Lens.Lens' ContactChannel ContactChannelAddress
contactChannel_deliveryAddress :: (ContactChannelAddress -> f ContactChannelAddress)
-> ContactChannel -> f ContactChannel
contactChannel_deliveryAddress = (ContactChannel -> ContactChannelAddress)
-> (ContactChannel -> ContactChannelAddress -> ContactChannel)
-> Lens
ContactChannel
ContactChannel
ContactChannelAddress
ContactChannelAddress
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactChannel' {ContactChannelAddress
deliveryAddress :: ContactChannelAddress
$sel:deliveryAddress:ContactChannel' :: ContactChannel -> ContactChannelAddress
deliveryAddress} -> ContactChannelAddress
deliveryAddress) (\s :: ContactChannel
s@ContactChannel' {} ContactChannelAddress
a -> ContactChannel
s {$sel:deliveryAddress:ContactChannel' :: ContactChannelAddress
deliveryAddress = ContactChannelAddress
a} :: ContactChannel)
contactChannel_activationStatus :: Lens.Lens' ContactChannel ActivationStatus
contactChannel_activationStatus :: (ActivationStatus -> f ActivationStatus)
-> ContactChannel -> f ContactChannel
contactChannel_activationStatus = (ContactChannel -> ActivationStatus)
-> (ContactChannel -> ActivationStatus -> ContactChannel)
-> Lens
ContactChannel ContactChannel ActivationStatus ActivationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactChannel' {ActivationStatus
activationStatus :: ActivationStatus
$sel:activationStatus:ContactChannel' :: ContactChannel -> ActivationStatus
activationStatus} -> ActivationStatus
activationStatus) (\s :: ContactChannel
s@ContactChannel' {} ActivationStatus
a -> ContactChannel
s {$sel:activationStatus:ContactChannel' :: ActivationStatus
activationStatus = ActivationStatus
a} :: ContactChannel)
instance Core.FromJSON ContactChannel where
parseJSON :: Value -> Parser ContactChannel
parseJSON =
String
-> (Object -> Parser ContactChannel)
-> Value
-> Parser ContactChannel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContactChannel"
( \Object
x ->
Maybe ChannelType
-> Text
-> Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel
ContactChannel'
(Maybe ChannelType
-> Text
-> Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel)
-> Parser (Maybe ChannelType)
-> Parser
(Text
-> Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ChannelType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser
(Text
-> Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel)
-> Parser Text
-> Parser
(Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ContactChannelArn")
Parser
(Text
-> Text
-> ContactChannelAddress
-> ActivationStatus
-> ContactChannel)
-> Parser Text
-> Parser
(Text
-> ContactChannelAddress -> ActivationStatus -> ContactChannel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ContactArn")
Parser
(Text
-> ContactChannelAddress -> ActivationStatus -> ContactChannel)
-> Parser Text
-> Parser
(ContactChannelAddress -> ActivationStatus -> ContactChannel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
Parser
(ContactChannelAddress -> ActivationStatus -> ContactChannel)
-> Parser ContactChannelAddress
-> Parser (ActivationStatus -> ContactChannel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ContactChannelAddress
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DeliveryAddress")
Parser (ActivationStatus -> ContactChannel)
-> Parser ActivationStatus -> Parser ContactChannel
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActivationStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ActivationStatus")
)
instance Prelude.Hashable ContactChannel
instance Prelude.NFData ContactChannel