{-# 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.SES.CreateReceiptFilter
(
CreateReceiptFilter (..),
newCreateReceiptFilter,
createReceiptFilter_filter,
CreateReceiptFilterResponse (..),
newCreateReceiptFilterResponse,
createReceiptFilterResponse_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.SES.Types
data CreateReceiptFilter = CreateReceiptFilter'
{
CreateReceiptFilter -> ReceiptFilter
filter' :: ReceiptFilter
}
deriving (CreateReceiptFilter -> CreateReceiptFilter -> Bool
(CreateReceiptFilter -> CreateReceiptFilter -> Bool)
-> (CreateReceiptFilter -> CreateReceiptFilter -> Bool)
-> Eq CreateReceiptFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateReceiptFilter -> CreateReceiptFilter -> Bool
$c/= :: CreateReceiptFilter -> CreateReceiptFilter -> Bool
== :: CreateReceiptFilter -> CreateReceiptFilter -> Bool
$c== :: CreateReceiptFilter -> CreateReceiptFilter -> Bool
Prelude.Eq, ReadPrec [CreateReceiptFilter]
ReadPrec CreateReceiptFilter
Int -> ReadS CreateReceiptFilter
ReadS [CreateReceiptFilter]
(Int -> ReadS CreateReceiptFilter)
-> ReadS [CreateReceiptFilter]
-> ReadPrec CreateReceiptFilter
-> ReadPrec [CreateReceiptFilter]
-> Read CreateReceiptFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateReceiptFilter]
$creadListPrec :: ReadPrec [CreateReceiptFilter]
readPrec :: ReadPrec CreateReceiptFilter
$creadPrec :: ReadPrec CreateReceiptFilter
readList :: ReadS [CreateReceiptFilter]
$creadList :: ReadS [CreateReceiptFilter]
readsPrec :: Int -> ReadS CreateReceiptFilter
$creadsPrec :: Int -> ReadS CreateReceiptFilter
Prelude.Read, Int -> CreateReceiptFilter -> ShowS
[CreateReceiptFilter] -> ShowS
CreateReceiptFilter -> String
(Int -> CreateReceiptFilter -> ShowS)
-> (CreateReceiptFilter -> String)
-> ([CreateReceiptFilter] -> ShowS)
-> Show CreateReceiptFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateReceiptFilter] -> ShowS
$cshowList :: [CreateReceiptFilter] -> ShowS
show :: CreateReceiptFilter -> String
$cshow :: CreateReceiptFilter -> String
showsPrec :: Int -> CreateReceiptFilter -> ShowS
$cshowsPrec :: Int -> CreateReceiptFilter -> ShowS
Prelude.Show, (forall x. CreateReceiptFilter -> Rep CreateReceiptFilter x)
-> (forall x. Rep CreateReceiptFilter x -> CreateReceiptFilter)
-> Generic CreateReceiptFilter
forall x. Rep CreateReceiptFilter x -> CreateReceiptFilter
forall x. CreateReceiptFilter -> Rep CreateReceiptFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateReceiptFilter x -> CreateReceiptFilter
$cfrom :: forall x. CreateReceiptFilter -> Rep CreateReceiptFilter x
Prelude.Generic)
newCreateReceiptFilter ::
ReceiptFilter ->
CreateReceiptFilter
newCreateReceiptFilter :: ReceiptFilter -> CreateReceiptFilter
newCreateReceiptFilter ReceiptFilter
pFilter_ =
CreateReceiptFilter' :: ReceiptFilter -> CreateReceiptFilter
CreateReceiptFilter' {$sel:filter':CreateReceiptFilter' :: ReceiptFilter
filter' = ReceiptFilter
pFilter_}
createReceiptFilter_filter :: Lens.Lens' CreateReceiptFilter ReceiptFilter
createReceiptFilter_filter :: (ReceiptFilter -> f ReceiptFilter)
-> CreateReceiptFilter -> f CreateReceiptFilter
createReceiptFilter_filter = (CreateReceiptFilter -> ReceiptFilter)
-> (CreateReceiptFilter -> ReceiptFilter -> CreateReceiptFilter)
-> Lens
CreateReceiptFilter CreateReceiptFilter ReceiptFilter ReceiptFilter
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReceiptFilter' {ReceiptFilter
filter' :: ReceiptFilter
$sel:filter':CreateReceiptFilter' :: CreateReceiptFilter -> ReceiptFilter
filter'} -> ReceiptFilter
filter') (\s :: CreateReceiptFilter
s@CreateReceiptFilter' {} ReceiptFilter
a -> CreateReceiptFilter
s {$sel:filter':CreateReceiptFilter' :: ReceiptFilter
filter' = ReceiptFilter
a} :: CreateReceiptFilter)
instance Core.AWSRequest CreateReceiptFilter where
type
AWSResponse CreateReceiptFilter =
CreateReceiptFilterResponse
request :: CreateReceiptFilter -> Request CreateReceiptFilter
request = Service -> CreateReceiptFilter -> Request CreateReceiptFilter
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateReceiptFilter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateReceiptFilter)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateReceiptFilter))
-> Logger
-> Service
-> Proxy CreateReceiptFilter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateReceiptFilter)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateReceiptFilterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateReceiptFilterResponse
CreateReceiptFilterResponse'
(Int -> CreateReceiptFilterResponse)
-> Either String Int -> Either String CreateReceiptFilterResponse
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 CreateReceiptFilter
instance Prelude.NFData CreateReceiptFilter
instance Core.ToHeaders CreateReceiptFilter where
toHeaders :: CreateReceiptFilter -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateReceiptFilter -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateReceiptFilter where
toPath :: CreateReceiptFilter -> ByteString
toPath = ByteString -> CreateReceiptFilter -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateReceiptFilter where
toQuery :: CreateReceiptFilter -> QueryString
toQuery CreateReceiptFilter' {ReceiptFilter
filter' :: ReceiptFilter
$sel:filter':CreateReceiptFilter' :: CreateReceiptFilter -> ReceiptFilter
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateReceiptFilter" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"Filter" ByteString -> ReceiptFilter -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ReceiptFilter
filter'
]
data CreateReceiptFilterResponse = CreateReceiptFilterResponse'
{
CreateReceiptFilterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateReceiptFilterResponse -> CreateReceiptFilterResponse -> Bool
(CreateReceiptFilterResponse
-> CreateReceiptFilterResponse -> Bool)
-> (CreateReceiptFilterResponse
-> CreateReceiptFilterResponse -> Bool)
-> Eq CreateReceiptFilterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateReceiptFilterResponse -> CreateReceiptFilterResponse -> Bool
$c/= :: CreateReceiptFilterResponse -> CreateReceiptFilterResponse -> Bool
== :: CreateReceiptFilterResponse -> CreateReceiptFilterResponse -> Bool
$c== :: CreateReceiptFilterResponse -> CreateReceiptFilterResponse -> Bool
Prelude.Eq, ReadPrec [CreateReceiptFilterResponse]
ReadPrec CreateReceiptFilterResponse
Int -> ReadS CreateReceiptFilterResponse
ReadS [CreateReceiptFilterResponse]
(Int -> ReadS CreateReceiptFilterResponse)
-> ReadS [CreateReceiptFilterResponse]
-> ReadPrec CreateReceiptFilterResponse
-> ReadPrec [CreateReceiptFilterResponse]
-> Read CreateReceiptFilterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateReceiptFilterResponse]
$creadListPrec :: ReadPrec [CreateReceiptFilterResponse]
readPrec :: ReadPrec CreateReceiptFilterResponse
$creadPrec :: ReadPrec CreateReceiptFilterResponse
readList :: ReadS [CreateReceiptFilterResponse]
$creadList :: ReadS [CreateReceiptFilterResponse]
readsPrec :: Int -> ReadS CreateReceiptFilterResponse
$creadsPrec :: Int -> ReadS CreateReceiptFilterResponse
Prelude.Read, Int -> CreateReceiptFilterResponse -> ShowS
[CreateReceiptFilterResponse] -> ShowS
CreateReceiptFilterResponse -> String
(Int -> CreateReceiptFilterResponse -> ShowS)
-> (CreateReceiptFilterResponse -> String)
-> ([CreateReceiptFilterResponse] -> ShowS)
-> Show CreateReceiptFilterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateReceiptFilterResponse] -> ShowS
$cshowList :: [CreateReceiptFilterResponse] -> ShowS
show :: CreateReceiptFilterResponse -> String
$cshow :: CreateReceiptFilterResponse -> String
showsPrec :: Int -> CreateReceiptFilterResponse -> ShowS
$cshowsPrec :: Int -> CreateReceiptFilterResponse -> ShowS
Prelude.Show, (forall x.
CreateReceiptFilterResponse -> Rep CreateReceiptFilterResponse x)
-> (forall x.
Rep CreateReceiptFilterResponse x -> CreateReceiptFilterResponse)
-> Generic CreateReceiptFilterResponse
forall x.
Rep CreateReceiptFilterResponse x -> CreateReceiptFilterResponse
forall x.
CreateReceiptFilterResponse -> Rep CreateReceiptFilterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateReceiptFilterResponse x -> CreateReceiptFilterResponse
$cfrom :: forall x.
CreateReceiptFilterResponse -> Rep CreateReceiptFilterResponse x
Prelude.Generic)
newCreateReceiptFilterResponse ::
Prelude.Int ->
CreateReceiptFilterResponse
newCreateReceiptFilterResponse :: Int -> CreateReceiptFilterResponse
newCreateReceiptFilterResponse Int
pHttpStatus_ =
CreateReceiptFilterResponse' :: Int -> CreateReceiptFilterResponse
CreateReceiptFilterResponse'
{ $sel:httpStatus:CreateReceiptFilterResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createReceiptFilterResponse_httpStatus :: Lens.Lens' CreateReceiptFilterResponse Prelude.Int
createReceiptFilterResponse_httpStatus :: (Int -> f Int)
-> CreateReceiptFilterResponse -> f CreateReceiptFilterResponse
createReceiptFilterResponse_httpStatus = (CreateReceiptFilterResponse -> Int)
-> (CreateReceiptFilterResponse
-> Int -> CreateReceiptFilterResponse)
-> Lens
CreateReceiptFilterResponse CreateReceiptFilterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReceiptFilterResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateReceiptFilterResponse' :: CreateReceiptFilterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateReceiptFilterResponse
s@CreateReceiptFilterResponse' {} Int
a -> CreateReceiptFilterResponse
s {$sel:httpStatus:CreateReceiptFilterResponse' :: Int
httpStatus = Int
a} :: CreateReceiptFilterResponse)
instance Prelude.NFData CreateReceiptFilterResponse