{-# 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.CloudFront.Types.OriginCustomHeader 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 (OriginCustomHeader -> OriginCustomHeader -> Bool
(OriginCustomHeader -> OriginCustomHeader -> Bool)
-> (OriginCustomHeader -> OriginCustomHeader -> Bool)
-> Eq OriginCustomHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OriginCustomHeader -> OriginCustomHeader -> Bool
$c/= :: OriginCustomHeader -> OriginCustomHeader -> Bool
== :: OriginCustomHeader -> OriginCustomHeader -> Bool
$c== :: OriginCustomHeader -> OriginCustomHeader -> Bool
Prelude.Eq, ReadPrec [OriginCustomHeader]
ReadPrec OriginCustomHeader
Int -> ReadS OriginCustomHeader
ReadS [OriginCustomHeader]
(Int -> ReadS OriginCustomHeader)
-> ReadS [OriginCustomHeader]
-> ReadPrec OriginCustomHeader
-> ReadPrec [OriginCustomHeader]
-> Read OriginCustomHeader
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OriginCustomHeader]
$creadListPrec :: ReadPrec [OriginCustomHeader]
readPrec :: ReadPrec OriginCustomHeader
$creadPrec :: ReadPrec OriginCustomHeader
readList :: ReadS [OriginCustomHeader]
$creadList :: ReadS [OriginCustomHeader]
readsPrec :: Int -> ReadS OriginCustomHeader
$creadsPrec :: Int -> ReadS OriginCustomHeader
Prelude.Read, Int -> OriginCustomHeader -> ShowS
[OriginCustomHeader] -> ShowS
OriginCustomHeader -> String
(Int -> OriginCustomHeader -> ShowS)
-> (OriginCustomHeader -> String)
-> ([OriginCustomHeader] -> ShowS)
-> Show OriginCustomHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OriginCustomHeader] -> ShowS
$cshowList :: [OriginCustomHeader] -> ShowS
show :: OriginCustomHeader -> String
$cshow :: OriginCustomHeader -> String
showsPrec :: Int -> OriginCustomHeader -> ShowS
$cshowsPrec :: Int -> OriginCustomHeader -> ShowS
Prelude.Show, (forall x. OriginCustomHeader -> Rep OriginCustomHeader x)
-> (forall x. Rep OriginCustomHeader x -> OriginCustomHeader)
-> Generic OriginCustomHeader
forall x. Rep OriginCustomHeader x -> OriginCustomHeader
forall x. OriginCustomHeader -> Rep OriginCustomHeader x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OriginCustomHeader x -> OriginCustomHeader
$cfrom :: forall x. OriginCustomHeader -> Rep OriginCustomHeader x
Prelude.Generic)
newOriginCustomHeader ::
Prelude.Text ->
Prelude.Text ->
OriginCustomHeader
Text
pHeaderName_ Text
pHeaderValue_ =
OriginCustomHeader' :: Text -> Text -> OriginCustomHeader
OriginCustomHeader'
{ $sel:headerName:OriginCustomHeader' :: Text
headerName = Text
pHeaderName_,
$sel:headerValue:OriginCustomHeader' :: Text
headerValue = Text
pHeaderValue_
}
originCustomHeader_headerName :: Lens.Lens' OriginCustomHeader Prelude.Text
= (OriginCustomHeader -> Text)
-> (OriginCustomHeader -> Text -> OriginCustomHeader)
-> Lens OriginCustomHeader OriginCustomHeader Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OriginCustomHeader' {Text
headerName :: Text
$sel:headerName:OriginCustomHeader' :: OriginCustomHeader -> Text
headerName} -> Text
headerName) (\s :: OriginCustomHeader
s@OriginCustomHeader' {} Text
a -> OriginCustomHeader
s {$sel:headerName:OriginCustomHeader' :: Text
headerName = Text
a} :: OriginCustomHeader)
originCustomHeader_headerValue :: Lens.Lens' OriginCustomHeader Prelude.Text
= (OriginCustomHeader -> Text)
-> (OriginCustomHeader -> Text -> OriginCustomHeader)
-> Lens OriginCustomHeader OriginCustomHeader Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OriginCustomHeader' {Text
headerValue :: Text
$sel:headerValue:OriginCustomHeader' :: OriginCustomHeader -> Text
headerValue} -> Text
headerValue) (\s :: OriginCustomHeader
s@OriginCustomHeader' {} Text
a -> OriginCustomHeader
s {$sel:headerValue:OriginCustomHeader' :: Text
headerValue = Text
a} :: OriginCustomHeader)
instance Core.FromXML OriginCustomHeader where
parseXML :: [Node] -> Either String OriginCustomHeader
parseXML [Node]
x =
Text -> Text -> OriginCustomHeader
OriginCustomHeader'
(Text -> Text -> OriginCustomHeader)
-> Either String Text -> Either String (Text -> OriginCustomHeader)
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 -> OriginCustomHeader)
-> Either String Text -> Either String OriginCustomHeader
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 OriginCustomHeader
instance Prelude.NFData OriginCustomHeader
instance Core.ToXML OriginCustomHeader where
toXML :: OriginCustomHeader -> XML
toXML OriginCustomHeader' {Text
headerValue :: Text
headerName :: Text
$sel:headerValue:OriginCustomHeader' :: OriginCustomHeader -> Text
$sel:headerName:OriginCustomHeader' :: OriginCustomHeader -> Text
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"HeaderName" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
headerName,
Name
"HeaderValue" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
headerValue
]