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