{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.PinpointEmail.PutConfigurationSetDeliveryOptions
(
PutConfigurationSetDeliveryOptions (..),
newPutConfigurationSetDeliveryOptions,
putConfigurationSetDeliveryOptions_sendingPoolName,
putConfigurationSetDeliveryOptions_tlsPolicy,
putConfigurationSetDeliveryOptions_configurationSetName,
PutConfigurationSetDeliveryOptionsResponse (..),
newPutConfigurationSetDeliveryOptionsResponse,
putConfigurationSetDeliveryOptionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointEmail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutConfigurationSetDeliveryOptions = PutConfigurationSetDeliveryOptions'
{
PutConfigurationSetDeliveryOptions -> Maybe Text
sendingPoolName :: Prelude.Maybe Prelude.Text,
PutConfigurationSetDeliveryOptions -> Maybe TlsPolicy
tlsPolicy :: Prelude.Maybe TlsPolicy,
PutConfigurationSetDeliveryOptions -> Text
configurationSetName :: Prelude.Text
}
deriving (PutConfigurationSetDeliveryOptions
-> PutConfigurationSetDeliveryOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutConfigurationSetDeliveryOptions
-> PutConfigurationSetDeliveryOptions -> Bool
$c/= :: PutConfigurationSetDeliveryOptions
-> PutConfigurationSetDeliveryOptions -> Bool
== :: PutConfigurationSetDeliveryOptions
-> PutConfigurationSetDeliveryOptions -> Bool
$c== :: PutConfigurationSetDeliveryOptions
-> PutConfigurationSetDeliveryOptions -> Bool
Prelude.Eq, ReadPrec [PutConfigurationSetDeliveryOptions]
ReadPrec PutConfigurationSetDeliveryOptions
Int -> ReadS PutConfigurationSetDeliveryOptions
ReadS [PutConfigurationSetDeliveryOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutConfigurationSetDeliveryOptions]
$creadListPrec :: ReadPrec [PutConfigurationSetDeliveryOptions]
readPrec :: ReadPrec PutConfigurationSetDeliveryOptions
$creadPrec :: ReadPrec PutConfigurationSetDeliveryOptions
readList :: ReadS [PutConfigurationSetDeliveryOptions]
$creadList :: ReadS [PutConfigurationSetDeliveryOptions]
readsPrec :: Int -> ReadS PutConfigurationSetDeliveryOptions
$creadsPrec :: Int -> ReadS PutConfigurationSetDeliveryOptions
Prelude.Read, Int -> PutConfigurationSetDeliveryOptions -> ShowS
[PutConfigurationSetDeliveryOptions] -> ShowS
PutConfigurationSetDeliveryOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutConfigurationSetDeliveryOptions] -> ShowS
$cshowList :: [PutConfigurationSetDeliveryOptions] -> ShowS
show :: PutConfigurationSetDeliveryOptions -> String
$cshow :: PutConfigurationSetDeliveryOptions -> String
showsPrec :: Int -> PutConfigurationSetDeliveryOptions -> ShowS
$cshowsPrec :: Int -> PutConfigurationSetDeliveryOptions -> ShowS
Prelude.Show, forall x.
Rep PutConfigurationSetDeliveryOptions x
-> PutConfigurationSetDeliveryOptions
forall x.
PutConfigurationSetDeliveryOptions
-> Rep PutConfigurationSetDeliveryOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutConfigurationSetDeliveryOptions x
-> PutConfigurationSetDeliveryOptions
$cfrom :: forall x.
PutConfigurationSetDeliveryOptions
-> Rep PutConfigurationSetDeliveryOptions x
Prelude.Generic)
newPutConfigurationSetDeliveryOptions ::
Prelude.Text ->
PutConfigurationSetDeliveryOptions
newPutConfigurationSetDeliveryOptions :: Text -> PutConfigurationSetDeliveryOptions
newPutConfigurationSetDeliveryOptions
Text
pConfigurationSetName_ =
PutConfigurationSetDeliveryOptions'
{ $sel:sendingPoolName:PutConfigurationSetDeliveryOptions' :: Maybe Text
sendingPoolName =
forall a. Maybe a
Prelude.Nothing,
$sel:tlsPolicy:PutConfigurationSetDeliveryOptions' :: Maybe TlsPolicy
tlsPolicy = forall a. Maybe a
Prelude.Nothing,
$sel:configurationSetName:PutConfigurationSetDeliveryOptions' :: Text
configurationSetName =
Text
pConfigurationSetName_
}
putConfigurationSetDeliveryOptions_sendingPoolName :: Lens.Lens' PutConfigurationSetDeliveryOptions (Prelude.Maybe Prelude.Text)
putConfigurationSetDeliveryOptions_sendingPoolName :: Lens' PutConfigurationSetDeliveryOptions (Maybe Text)
putConfigurationSetDeliveryOptions_sendingPoolName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetDeliveryOptions' {Maybe Text
sendingPoolName :: Maybe Text
$sel:sendingPoolName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe Text
sendingPoolName} -> Maybe Text
sendingPoolName) (\s :: PutConfigurationSetDeliveryOptions
s@PutConfigurationSetDeliveryOptions' {} Maybe Text
a -> PutConfigurationSetDeliveryOptions
s {$sel:sendingPoolName:PutConfigurationSetDeliveryOptions' :: Maybe Text
sendingPoolName = Maybe Text
a} :: PutConfigurationSetDeliveryOptions)
putConfigurationSetDeliveryOptions_tlsPolicy :: Lens.Lens' PutConfigurationSetDeliveryOptions (Prelude.Maybe TlsPolicy)
putConfigurationSetDeliveryOptions_tlsPolicy :: Lens' PutConfigurationSetDeliveryOptions (Maybe TlsPolicy)
putConfigurationSetDeliveryOptions_tlsPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetDeliveryOptions' {Maybe TlsPolicy
tlsPolicy :: Maybe TlsPolicy
$sel:tlsPolicy:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe TlsPolicy
tlsPolicy} -> Maybe TlsPolicy
tlsPolicy) (\s :: PutConfigurationSetDeliveryOptions
s@PutConfigurationSetDeliveryOptions' {} Maybe TlsPolicy
a -> PutConfigurationSetDeliveryOptions
s {$sel:tlsPolicy:PutConfigurationSetDeliveryOptions' :: Maybe TlsPolicy
tlsPolicy = Maybe TlsPolicy
a} :: PutConfigurationSetDeliveryOptions)
putConfigurationSetDeliveryOptions_configurationSetName :: Lens.Lens' PutConfigurationSetDeliveryOptions Prelude.Text
putConfigurationSetDeliveryOptions_configurationSetName :: Lens' PutConfigurationSetDeliveryOptions Text
putConfigurationSetDeliveryOptions_configurationSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetDeliveryOptions' {Text
configurationSetName :: Text
$sel:configurationSetName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Text
configurationSetName} -> Text
configurationSetName) (\s :: PutConfigurationSetDeliveryOptions
s@PutConfigurationSetDeliveryOptions' {} Text
a -> PutConfigurationSetDeliveryOptions
s {$sel:configurationSetName:PutConfigurationSetDeliveryOptions' :: Text
configurationSetName = Text
a} :: PutConfigurationSetDeliveryOptions)
instance
Core.AWSRequest
PutConfigurationSetDeliveryOptions
where
type
AWSResponse PutConfigurationSetDeliveryOptions =
PutConfigurationSetDeliveryOptionsResponse
request :: (Service -> Service)
-> PutConfigurationSetDeliveryOptions
-> Request PutConfigurationSetDeliveryOptions
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutConfigurationSetDeliveryOptions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutConfigurationSetDeliveryOptions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutConfigurationSetDeliveryOptionsResponse
PutConfigurationSetDeliveryOptionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
PutConfigurationSetDeliveryOptions
where
hashWithSalt :: Int -> PutConfigurationSetDeliveryOptions -> Int
hashWithSalt
Int
_salt
PutConfigurationSetDeliveryOptions' {Maybe Text
Maybe TlsPolicy
Text
configurationSetName :: Text
tlsPolicy :: Maybe TlsPolicy
sendingPoolName :: Maybe Text
$sel:configurationSetName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Text
$sel:tlsPolicy:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe TlsPolicy
$sel:sendingPoolName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sendingPoolName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TlsPolicy
tlsPolicy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationSetName
instance
Prelude.NFData
PutConfigurationSetDeliveryOptions
where
rnf :: PutConfigurationSetDeliveryOptions -> ()
rnf PutConfigurationSetDeliveryOptions' {Maybe Text
Maybe TlsPolicy
Text
configurationSetName :: Text
tlsPolicy :: Maybe TlsPolicy
sendingPoolName :: Maybe Text
$sel:configurationSetName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Text
$sel:tlsPolicy:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe TlsPolicy
$sel:sendingPoolName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sendingPoolName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TlsPolicy
tlsPolicy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
configurationSetName
instance
Data.ToHeaders
PutConfigurationSetDeliveryOptions
where
toHeaders :: PutConfigurationSetDeliveryOptions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Data.ToJSON
PutConfigurationSetDeliveryOptions
where
toJSON :: PutConfigurationSetDeliveryOptions -> Value
toJSON PutConfigurationSetDeliveryOptions' {Maybe Text
Maybe TlsPolicy
Text
configurationSetName :: Text
tlsPolicy :: Maybe TlsPolicy
sendingPoolName :: Maybe Text
$sel:configurationSetName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Text
$sel:tlsPolicy:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe TlsPolicy
$sel:sendingPoolName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SendingPoolName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sendingPoolName,
(Key
"TlsPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TlsPolicy
tlsPolicy
]
)
instance
Data.ToPath
PutConfigurationSetDeliveryOptions
where
toPath :: PutConfigurationSetDeliveryOptions -> ByteString
toPath PutConfigurationSetDeliveryOptions' {Maybe Text
Maybe TlsPolicy
Text
configurationSetName :: Text
tlsPolicy :: Maybe TlsPolicy
sendingPoolName :: Maybe Text
$sel:configurationSetName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Text
$sel:tlsPolicy:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe TlsPolicy
$sel:sendingPoolName:PutConfigurationSetDeliveryOptions' :: PutConfigurationSetDeliveryOptions -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/email/configuration-sets/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
configurationSetName,
ByteString
"/delivery-options"
]
instance
Data.ToQuery
PutConfigurationSetDeliveryOptions
where
toQuery :: PutConfigurationSetDeliveryOptions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutConfigurationSetDeliveryOptionsResponse = PutConfigurationSetDeliveryOptionsResponse'
{
PutConfigurationSetDeliveryOptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutConfigurationSetDeliveryOptionsResponse
-> PutConfigurationSetDeliveryOptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutConfigurationSetDeliveryOptionsResponse
-> PutConfigurationSetDeliveryOptionsResponse -> Bool
$c/= :: PutConfigurationSetDeliveryOptionsResponse
-> PutConfigurationSetDeliveryOptionsResponse -> Bool
== :: PutConfigurationSetDeliveryOptionsResponse
-> PutConfigurationSetDeliveryOptionsResponse -> Bool
$c== :: PutConfigurationSetDeliveryOptionsResponse
-> PutConfigurationSetDeliveryOptionsResponse -> Bool
Prelude.Eq, ReadPrec [PutConfigurationSetDeliveryOptionsResponse]
ReadPrec PutConfigurationSetDeliveryOptionsResponse
Int -> ReadS PutConfigurationSetDeliveryOptionsResponse
ReadS [PutConfigurationSetDeliveryOptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutConfigurationSetDeliveryOptionsResponse]
$creadListPrec :: ReadPrec [PutConfigurationSetDeliveryOptionsResponse]
readPrec :: ReadPrec PutConfigurationSetDeliveryOptionsResponse
$creadPrec :: ReadPrec PutConfigurationSetDeliveryOptionsResponse
readList :: ReadS [PutConfigurationSetDeliveryOptionsResponse]
$creadList :: ReadS [PutConfigurationSetDeliveryOptionsResponse]
readsPrec :: Int -> ReadS PutConfigurationSetDeliveryOptionsResponse
$creadsPrec :: Int -> ReadS PutConfigurationSetDeliveryOptionsResponse
Prelude.Read, Int -> PutConfigurationSetDeliveryOptionsResponse -> ShowS
[PutConfigurationSetDeliveryOptionsResponse] -> ShowS
PutConfigurationSetDeliveryOptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutConfigurationSetDeliveryOptionsResponse] -> ShowS
$cshowList :: [PutConfigurationSetDeliveryOptionsResponse] -> ShowS
show :: PutConfigurationSetDeliveryOptionsResponse -> String
$cshow :: PutConfigurationSetDeliveryOptionsResponse -> String
showsPrec :: Int -> PutConfigurationSetDeliveryOptionsResponse -> ShowS
$cshowsPrec :: Int -> PutConfigurationSetDeliveryOptionsResponse -> ShowS
Prelude.Show, forall x.
Rep PutConfigurationSetDeliveryOptionsResponse x
-> PutConfigurationSetDeliveryOptionsResponse
forall x.
PutConfigurationSetDeliveryOptionsResponse
-> Rep PutConfigurationSetDeliveryOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutConfigurationSetDeliveryOptionsResponse x
-> PutConfigurationSetDeliveryOptionsResponse
$cfrom :: forall x.
PutConfigurationSetDeliveryOptionsResponse
-> Rep PutConfigurationSetDeliveryOptionsResponse x
Prelude.Generic)
newPutConfigurationSetDeliveryOptionsResponse ::
Prelude.Int ->
PutConfigurationSetDeliveryOptionsResponse
newPutConfigurationSetDeliveryOptionsResponse :: Int -> PutConfigurationSetDeliveryOptionsResponse
newPutConfigurationSetDeliveryOptionsResponse
Int
pHttpStatus_ =
PutConfigurationSetDeliveryOptionsResponse'
{ $sel:httpStatus:PutConfigurationSetDeliveryOptionsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putConfigurationSetDeliveryOptionsResponse_httpStatus :: Lens.Lens' PutConfigurationSetDeliveryOptionsResponse Prelude.Int
putConfigurationSetDeliveryOptionsResponse_httpStatus :: Lens' PutConfigurationSetDeliveryOptionsResponse Int
putConfigurationSetDeliveryOptionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetDeliveryOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutConfigurationSetDeliveryOptionsResponse' :: PutConfigurationSetDeliveryOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutConfigurationSetDeliveryOptionsResponse
s@PutConfigurationSetDeliveryOptionsResponse' {} Int
a -> PutConfigurationSetDeliveryOptionsResponse
s {$sel:httpStatus:PutConfigurationSetDeliveryOptionsResponse' :: Int
httpStatus = Int
a} :: PutConfigurationSetDeliveryOptionsResponse)
instance
Prelude.NFData
PutConfigurationSetDeliveryOptionsResponse
where
rnf :: PutConfigurationSetDeliveryOptionsResponse -> ()
rnf PutConfigurationSetDeliveryOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutConfigurationSetDeliveryOptionsResponse' :: PutConfigurationSetDeliveryOptionsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus