{-# 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.SESV2.PutConfigurationSetTrackingOptions
(
PutConfigurationSetTrackingOptions (..),
newPutConfigurationSetTrackingOptions,
putConfigurationSetTrackingOptions_customRedirectDomain,
putConfigurationSetTrackingOptions_configurationSetName,
PutConfigurationSetTrackingOptionsResponse (..),
newPutConfigurationSetTrackingOptionsResponse,
putConfigurationSetTrackingOptionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types
data PutConfigurationSetTrackingOptions = PutConfigurationSetTrackingOptions'
{
PutConfigurationSetTrackingOptions -> Maybe Text
customRedirectDomain :: Prelude.Maybe Prelude.Text,
PutConfigurationSetTrackingOptions -> Text
configurationSetName :: Prelude.Text
}
deriving (PutConfigurationSetTrackingOptions
-> PutConfigurationSetTrackingOptions -> Bool
(PutConfigurationSetTrackingOptions
-> PutConfigurationSetTrackingOptions -> Bool)
-> (PutConfigurationSetTrackingOptions
-> PutConfigurationSetTrackingOptions -> Bool)
-> Eq PutConfigurationSetTrackingOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutConfigurationSetTrackingOptions
-> PutConfigurationSetTrackingOptions -> Bool
$c/= :: PutConfigurationSetTrackingOptions
-> PutConfigurationSetTrackingOptions -> Bool
== :: PutConfigurationSetTrackingOptions
-> PutConfigurationSetTrackingOptions -> Bool
$c== :: PutConfigurationSetTrackingOptions
-> PutConfigurationSetTrackingOptions -> Bool
Prelude.Eq, ReadPrec [PutConfigurationSetTrackingOptions]
ReadPrec PutConfigurationSetTrackingOptions
Int -> ReadS PutConfigurationSetTrackingOptions
ReadS [PutConfigurationSetTrackingOptions]
(Int -> ReadS PutConfigurationSetTrackingOptions)
-> ReadS [PutConfigurationSetTrackingOptions]
-> ReadPrec PutConfigurationSetTrackingOptions
-> ReadPrec [PutConfigurationSetTrackingOptions]
-> Read PutConfigurationSetTrackingOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutConfigurationSetTrackingOptions]
$creadListPrec :: ReadPrec [PutConfigurationSetTrackingOptions]
readPrec :: ReadPrec PutConfigurationSetTrackingOptions
$creadPrec :: ReadPrec PutConfigurationSetTrackingOptions
readList :: ReadS [PutConfigurationSetTrackingOptions]
$creadList :: ReadS [PutConfigurationSetTrackingOptions]
readsPrec :: Int -> ReadS PutConfigurationSetTrackingOptions
$creadsPrec :: Int -> ReadS PutConfigurationSetTrackingOptions
Prelude.Read, Int -> PutConfigurationSetTrackingOptions -> ShowS
[PutConfigurationSetTrackingOptions] -> ShowS
PutConfigurationSetTrackingOptions -> String
(Int -> PutConfigurationSetTrackingOptions -> ShowS)
-> (PutConfigurationSetTrackingOptions -> String)
-> ([PutConfigurationSetTrackingOptions] -> ShowS)
-> Show PutConfigurationSetTrackingOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutConfigurationSetTrackingOptions] -> ShowS
$cshowList :: [PutConfigurationSetTrackingOptions] -> ShowS
show :: PutConfigurationSetTrackingOptions -> String
$cshow :: PutConfigurationSetTrackingOptions -> String
showsPrec :: Int -> PutConfigurationSetTrackingOptions -> ShowS
$cshowsPrec :: Int -> PutConfigurationSetTrackingOptions -> ShowS
Prelude.Show, (forall x.
PutConfigurationSetTrackingOptions
-> Rep PutConfigurationSetTrackingOptions x)
-> (forall x.
Rep PutConfigurationSetTrackingOptions x
-> PutConfigurationSetTrackingOptions)
-> Generic PutConfigurationSetTrackingOptions
forall x.
Rep PutConfigurationSetTrackingOptions x
-> PutConfigurationSetTrackingOptions
forall x.
PutConfigurationSetTrackingOptions
-> Rep PutConfigurationSetTrackingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutConfigurationSetTrackingOptions x
-> PutConfigurationSetTrackingOptions
$cfrom :: forall x.
PutConfigurationSetTrackingOptions
-> Rep PutConfigurationSetTrackingOptions x
Prelude.Generic)
newPutConfigurationSetTrackingOptions ::
Prelude.Text ->
PutConfigurationSetTrackingOptions
newPutConfigurationSetTrackingOptions :: Text -> PutConfigurationSetTrackingOptions
newPutConfigurationSetTrackingOptions
Text
pConfigurationSetName_ =
PutConfigurationSetTrackingOptions' :: Maybe Text -> Text -> PutConfigurationSetTrackingOptions
PutConfigurationSetTrackingOptions'
{ $sel:customRedirectDomain:PutConfigurationSetTrackingOptions' :: Maybe Text
customRedirectDomain =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configurationSetName:PutConfigurationSetTrackingOptions' :: Text
configurationSetName =
Text
pConfigurationSetName_
}
putConfigurationSetTrackingOptions_customRedirectDomain :: Lens.Lens' PutConfigurationSetTrackingOptions (Prelude.Maybe Prelude.Text)
putConfigurationSetTrackingOptions_customRedirectDomain :: (Maybe Text -> f (Maybe Text))
-> PutConfigurationSetTrackingOptions
-> f PutConfigurationSetTrackingOptions
putConfigurationSetTrackingOptions_customRedirectDomain = (PutConfigurationSetTrackingOptions -> Maybe Text)
-> (PutConfigurationSetTrackingOptions
-> Maybe Text -> PutConfigurationSetTrackingOptions)
-> Lens
PutConfigurationSetTrackingOptions
PutConfigurationSetTrackingOptions
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetTrackingOptions' {Maybe Text
customRedirectDomain :: Maybe Text
$sel:customRedirectDomain:PutConfigurationSetTrackingOptions' :: PutConfigurationSetTrackingOptions -> Maybe Text
customRedirectDomain} -> Maybe Text
customRedirectDomain) (\s :: PutConfigurationSetTrackingOptions
s@PutConfigurationSetTrackingOptions' {} Maybe Text
a -> PutConfigurationSetTrackingOptions
s {$sel:customRedirectDomain:PutConfigurationSetTrackingOptions' :: Maybe Text
customRedirectDomain = Maybe Text
a} :: PutConfigurationSetTrackingOptions)
putConfigurationSetTrackingOptions_configurationSetName :: Lens.Lens' PutConfigurationSetTrackingOptions Prelude.Text
putConfigurationSetTrackingOptions_configurationSetName :: (Text -> f Text)
-> PutConfigurationSetTrackingOptions
-> f PutConfigurationSetTrackingOptions
putConfigurationSetTrackingOptions_configurationSetName = (PutConfigurationSetTrackingOptions -> Text)
-> (PutConfigurationSetTrackingOptions
-> Text -> PutConfigurationSetTrackingOptions)
-> Lens
PutConfigurationSetTrackingOptions
PutConfigurationSetTrackingOptions
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetTrackingOptions' {Text
configurationSetName :: Text
$sel:configurationSetName:PutConfigurationSetTrackingOptions' :: PutConfigurationSetTrackingOptions -> Text
configurationSetName} -> Text
configurationSetName) (\s :: PutConfigurationSetTrackingOptions
s@PutConfigurationSetTrackingOptions' {} Text
a -> PutConfigurationSetTrackingOptions
s {$sel:configurationSetName:PutConfigurationSetTrackingOptions' :: Text
configurationSetName = Text
a} :: PutConfigurationSetTrackingOptions)
instance
Core.AWSRequest
PutConfigurationSetTrackingOptions
where
type
AWSResponse PutConfigurationSetTrackingOptions =
PutConfigurationSetTrackingOptionsResponse
request :: PutConfigurationSetTrackingOptions
-> Request PutConfigurationSetTrackingOptions
request = Service
-> PutConfigurationSetTrackingOptions
-> Request PutConfigurationSetTrackingOptions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutConfigurationSetTrackingOptions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutConfigurationSetTrackingOptions)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutConfigurationSetTrackingOptions))
-> Logger
-> Service
-> Proxy PutConfigurationSetTrackingOptions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutConfigurationSetTrackingOptions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutConfigurationSetTrackingOptionsResponse
PutConfigurationSetTrackingOptionsResponse'
(Int -> PutConfigurationSetTrackingOptionsResponse)
-> Either String Int
-> Either String PutConfigurationSetTrackingOptionsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
PutConfigurationSetTrackingOptions
instance
Prelude.NFData
PutConfigurationSetTrackingOptions
instance
Core.ToHeaders
PutConfigurationSetTrackingOptions
where
toHeaders :: PutConfigurationSetTrackingOptions -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutConfigurationSetTrackingOptions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Core.ToJSON
PutConfigurationSetTrackingOptions
where
toJSON :: PutConfigurationSetTrackingOptions -> Value
toJSON PutConfigurationSetTrackingOptions' {Maybe Text
Text
configurationSetName :: Text
customRedirectDomain :: Maybe Text
$sel:configurationSetName:PutConfigurationSetTrackingOptions' :: PutConfigurationSetTrackingOptions -> Text
$sel:customRedirectDomain:PutConfigurationSetTrackingOptions' :: PutConfigurationSetTrackingOptions -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CustomRedirectDomain" 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
customRedirectDomain
]
)
instance
Core.ToPath
PutConfigurationSetTrackingOptions
where
toPath :: PutConfigurationSetTrackingOptions -> ByteString
toPath PutConfigurationSetTrackingOptions' {Maybe Text
Text
configurationSetName :: Text
customRedirectDomain :: Maybe Text
$sel:configurationSetName:PutConfigurationSetTrackingOptions' :: PutConfigurationSetTrackingOptions -> Text
$sel:customRedirectDomain:PutConfigurationSetTrackingOptions' :: PutConfigurationSetTrackingOptions -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/configuration-sets/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
configurationSetName,
ByteString
"/tracking-options"
]
instance
Core.ToQuery
PutConfigurationSetTrackingOptions
where
toQuery :: PutConfigurationSetTrackingOptions -> QueryString
toQuery = QueryString -> PutConfigurationSetTrackingOptions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutConfigurationSetTrackingOptionsResponse = PutConfigurationSetTrackingOptionsResponse'
{
PutConfigurationSetTrackingOptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutConfigurationSetTrackingOptionsResponse
-> PutConfigurationSetTrackingOptionsResponse -> Bool
(PutConfigurationSetTrackingOptionsResponse
-> PutConfigurationSetTrackingOptionsResponse -> Bool)
-> (PutConfigurationSetTrackingOptionsResponse
-> PutConfigurationSetTrackingOptionsResponse -> Bool)
-> Eq PutConfigurationSetTrackingOptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutConfigurationSetTrackingOptionsResponse
-> PutConfigurationSetTrackingOptionsResponse -> Bool
$c/= :: PutConfigurationSetTrackingOptionsResponse
-> PutConfigurationSetTrackingOptionsResponse -> Bool
== :: PutConfigurationSetTrackingOptionsResponse
-> PutConfigurationSetTrackingOptionsResponse -> Bool
$c== :: PutConfigurationSetTrackingOptionsResponse
-> PutConfigurationSetTrackingOptionsResponse -> Bool
Prelude.Eq, ReadPrec [PutConfigurationSetTrackingOptionsResponse]
ReadPrec PutConfigurationSetTrackingOptionsResponse
Int -> ReadS PutConfigurationSetTrackingOptionsResponse
ReadS [PutConfigurationSetTrackingOptionsResponse]
(Int -> ReadS PutConfigurationSetTrackingOptionsResponse)
-> ReadS [PutConfigurationSetTrackingOptionsResponse]
-> ReadPrec PutConfigurationSetTrackingOptionsResponse
-> ReadPrec [PutConfigurationSetTrackingOptionsResponse]
-> Read PutConfigurationSetTrackingOptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutConfigurationSetTrackingOptionsResponse]
$creadListPrec :: ReadPrec [PutConfigurationSetTrackingOptionsResponse]
readPrec :: ReadPrec PutConfigurationSetTrackingOptionsResponse
$creadPrec :: ReadPrec PutConfigurationSetTrackingOptionsResponse
readList :: ReadS [PutConfigurationSetTrackingOptionsResponse]
$creadList :: ReadS [PutConfigurationSetTrackingOptionsResponse]
readsPrec :: Int -> ReadS PutConfigurationSetTrackingOptionsResponse
$creadsPrec :: Int -> ReadS PutConfigurationSetTrackingOptionsResponse
Prelude.Read, Int -> PutConfigurationSetTrackingOptionsResponse -> ShowS
[PutConfigurationSetTrackingOptionsResponse] -> ShowS
PutConfigurationSetTrackingOptionsResponse -> String
(Int -> PutConfigurationSetTrackingOptionsResponse -> ShowS)
-> (PutConfigurationSetTrackingOptionsResponse -> String)
-> ([PutConfigurationSetTrackingOptionsResponse] -> ShowS)
-> Show PutConfigurationSetTrackingOptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutConfigurationSetTrackingOptionsResponse] -> ShowS
$cshowList :: [PutConfigurationSetTrackingOptionsResponse] -> ShowS
show :: PutConfigurationSetTrackingOptionsResponse -> String
$cshow :: PutConfigurationSetTrackingOptionsResponse -> String
showsPrec :: Int -> PutConfigurationSetTrackingOptionsResponse -> ShowS
$cshowsPrec :: Int -> PutConfigurationSetTrackingOptionsResponse -> ShowS
Prelude.Show, (forall x.
PutConfigurationSetTrackingOptionsResponse
-> Rep PutConfigurationSetTrackingOptionsResponse x)
-> (forall x.
Rep PutConfigurationSetTrackingOptionsResponse x
-> PutConfigurationSetTrackingOptionsResponse)
-> Generic PutConfigurationSetTrackingOptionsResponse
forall x.
Rep PutConfigurationSetTrackingOptionsResponse x
-> PutConfigurationSetTrackingOptionsResponse
forall x.
PutConfigurationSetTrackingOptionsResponse
-> Rep PutConfigurationSetTrackingOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutConfigurationSetTrackingOptionsResponse x
-> PutConfigurationSetTrackingOptionsResponse
$cfrom :: forall x.
PutConfigurationSetTrackingOptionsResponse
-> Rep PutConfigurationSetTrackingOptionsResponse x
Prelude.Generic)
newPutConfigurationSetTrackingOptionsResponse ::
Prelude.Int ->
PutConfigurationSetTrackingOptionsResponse
newPutConfigurationSetTrackingOptionsResponse :: Int -> PutConfigurationSetTrackingOptionsResponse
newPutConfigurationSetTrackingOptionsResponse
Int
pHttpStatus_ =
PutConfigurationSetTrackingOptionsResponse' :: Int -> PutConfigurationSetTrackingOptionsResponse
PutConfigurationSetTrackingOptionsResponse'
{ $sel:httpStatus:PutConfigurationSetTrackingOptionsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putConfigurationSetTrackingOptionsResponse_httpStatus :: Lens.Lens' PutConfigurationSetTrackingOptionsResponse Prelude.Int
putConfigurationSetTrackingOptionsResponse_httpStatus :: (Int -> f Int)
-> PutConfigurationSetTrackingOptionsResponse
-> f PutConfigurationSetTrackingOptionsResponse
putConfigurationSetTrackingOptionsResponse_httpStatus = (PutConfigurationSetTrackingOptionsResponse -> Int)
-> (PutConfigurationSetTrackingOptionsResponse
-> Int -> PutConfigurationSetTrackingOptionsResponse)
-> Lens
PutConfigurationSetTrackingOptionsResponse
PutConfigurationSetTrackingOptionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConfigurationSetTrackingOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutConfigurationSetTrackingOptionsResponse' :: PutConfigurationSetTrackingOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutConfigurationSetTrackingOptionsResponse
s@PutConfigurationSetTrackingOptionsResponse' {} Int
a -> PutConfigurationSetTrackingOptionsResponse
s {$sel:httpStatus:PutConfigurationSetTrackingOptionsResponse' :: Int
httpStatus = Int
a} :: PutConfigurationSetTrackingOptionsResponse)
instance
Prelude.NFData
PutConfigurationSetTrackingOptionsResponse