{-# 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.SES.Types.DeliveryOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.TlsPolicy
data DeliveryOptions = DeliveryOptions'
{
DeliveryOptions -> Maybe TlsPolicy
tlsPolicy :: Prelude.Maybe TlsPolicy
}
deriving (DeliveryOptions -> DeliveryOptions -> Bool
(DeliveryOptions -> DeliveryOptions -> Bool)
-> (DeliveryOptions -> DeliveryOptions -> Bool)
-> Eq DeliveryOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeliveryOptions -> DeliveryOptions -> Bool
$c/= :: DeliveryOptions -> DeliveryOptions -> Bool
== :: DeliveryOptions -> DeliveryOptions -> Bool
$c== :: DeliveryOptions -> DeliveryOptions -> Bool
Prelude.Eq, ReadPrec [DeliveryOptions]
ReadPrec DeliveryOptions
Int -> ReadS DeliveryOptions
ReadS [DeliveryOptions]
(Int -> ReadS DeliveryOptions)
-> ReadS [DeliveryOptions]
-> ReadPrec DeliveryOptions
-> ReadPrec [DeliveryOptions]
-> Read DeliveryOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeliveryOptions]
$creadListPrec :: ReadPrec [DeliveryOptions]
readPrec :: ReadPrec DeliveryOptions
$creadPrec :: ReadPrec DeliveryOptions
readList :: ReadS [DeliveryOptions]
$creadList :: ReadS [DeliveryOptions]
readsPrec :: Int -> ReadS DeliveryOptions
$creadsPrec :: Int -> ReadS DeliveryOptions
Prelude.Read, Int -> DeliveryOptions -> ShowS
[DeliveryOptions] -> ShowS
DeliveryOptions -> String
(Int -> DeliveryOptions -> ShowS)
-> (DeliveryOptions -> String)
-> ([DeliveryOptions] -> ShowS)
-> Show DeliveryOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeliveryOptions] -> ShowS
$cshowList :: [DeliveryOptions] -> ShowS
show :: DeliveryOptions -> String
$cshow :: DeliveryOptions -> String
showsPrec :: Int -> DeliveryOptions -> ShowS
$cshowsPrec :: Int -> DeliveryOptions -> ShowS
Prelude.Show, (forall x. DeliveryOptions -> Rep DeliveryOptions x)
-> (forall x. Rep DeliveryOptions x -> DeliveryOptions)
-> Generic DeliveryOptions
forall x. Rep DeliveryOptions x -> DeliveryOptions
forall x. DeliveryOptions -> Rep DeliveryOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeliveryOptions x -> DeliveryOptions
$cfrom :: forall x. DeliveryOptions -> Rep DeliveryOptions x
Prelude.Generic)
newDeliveryOptions ::
DeliveryOptions
newDeliveryOptions :: DeliveryOptions
newDeliveryOptions =
DeliveryOptions' :: Maybe TlsPolicy -> DeliveryOptions
DeliveryOptions' {$sel:tlsPolicy:DeliveryOptions' :: Maybe TlsPolicy
tlsPolicy = Maybe TlsPolicy
forall a. Maybe a
Prelude.Nothing}
deliveryOptions_tlsPolicy :: Lens.Lens' DeliveryOptions (Prelude.Maybe TlsPolicy)
deliveryOptions_tlsPolicy :: (Maybe TlsPolicy -> f (Maybe TlsPolicy))
-> DeliveryOptions -> f DeliveryOptions
deliveryOptions_tlsPolicy = (DeliveryOptions -> Maybe TlsPolicy)
-> (DeliveryOptions -> Maybe TlsPolicy -> DeliveryOptions)
-> Lens
DeliveryOptions DeliveryOptions (Maybe TlsPolicy) (Maybe TlsPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryOptions' {Maybe TlsPolicy
tlsPolicy :: Maybe TlsPolicy
$sel:tlsPolicy:DeliveryOptions' :: DeliveryOptions -> Maybe TlsPolicy
tlsPolicy} -> Maybe TlsPolicy
tlsPolicy) (\s :: DeliveryOptions
s@DeliveryOptions' {} Maybe TlsPolicy
a -> DeliveryOptions
s {$sel:tlsPolicy:DeliveryOptions' :: Maybe TlsPolicy
tlsPolicy = Maybe TlsPolicy
a} :: DeliveryOptions)
instance Core.FromXML DeliveryOptions where
parseXML :: [Node] -> Either String DeliveryOptions
parseXML [Node]
x =
Maybe TlsPolicy -> DeliveryOptions
DeliveryOptions'
(Maybe TlsPolicy -> DeliveryOptions)
-> Either String (Maybe TlsPolicy) -> Either String DeliveryOptions
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe TlsPolicy)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TlsPolicy")
instance Prelude.Hashable DeliveryOptions
instance Prelude.NFData DeliveryOptions
instance Core.ToQuery DeliveryOptions where
toQuery :: DeliveryOptions -> QueryString
toQuery DeliveryOptions' {Maybe TlsPolicy
tlsPolicy :: Maybe TlsPolicy
$sel:tlsPolicy:DeliveryOptions' :: DeliveryOptions -> Maybe TlsPolicy
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"TlsPolicy" ByteString -> Maybe TlsPolicy -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TlsPolicy
tlsPolicy]