{-# 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.WAFRegional.Types.HTTPHeader where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data =
{
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text
}
deriving (HTTPHeader -> HTTPHeader -> Bool
(HTTPHeader -> HTTPHeader -> Bool)
-> (HTTPHeader -> HTTPHeader -> Bool) -> Eq HTTPHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HTTPHeader -> HTTPHeader -> Bool
$c/= :: HTTPHeader -> HTTPHeader -> Bool
== :: HTTPHeader -> HTTPHeader -> Bool
$c== :: HTTPHeader -> HTTPHeader -> Bool
Prelude.Eq, ReadPrec [HTTPHeader]
ReadPrec HTTPHeader
Int -> ReadS HTTPHeader
ReadS [HTTPHeader]
(Int -> ReadS HTTPHeader)
-> ReadS [HTTPHeader]
-> ReadPrec HTTPHeader
-> ReadPrec [HTTPHeader]
-> Read HTTPHeader
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HTTPHeader]
$creadListPrec :: ReadPrec [HTTPHeader]
readPrec :: ReadPrec HTTPHeader
$creadPrec :: ReadPrec HTTPHeader
readList :: ReadS [HTTPHeader]
$creadList :: ReadS [HTTPHeader]
readsPrec :: Int -> ReadS HTTPHeader
$creadsPrec :: Int -> ReadS HTTPHeader
Prelude.Read, Int -> HTTPHeader -> ShowS
[HTTPHeader] -> ShowS
HTTPHeader -> String
(Int -> HTTPHeader -> ShowS)
-> (HTTPHeader -> String)
-> ([HTTPHeader] -> ShowS)
-> Show HTTPHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HTTPHeader] -> ShowS
$cshowList :: [HTTPHeader] -> ShowS
show :: HTTPHeader -> String
$cshow :: HTTPHeader -> String
showsPrec :: Int -> HTTPHeader -> ShowS
$cshowsPrec :: Int -> HTTPHeader -> ShowS
Prelude.Show, (forall x. HTTPHeader -> Rep HTTPHeader x)
-> (forall x. Rep HTTPHeader x -> HTTPHeader) -> Generic HTTPHeader
forall x. Rep HTTPHeader x -> HTTPHeader
forall x. HTTPHeader -> Rep HTTPHeader x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HTTPHeader x -> HTTPHeader
$cfrom :: forall x. HTTPHeader -> Rep HTTPHeader x
Prelude.Generic)
newHTTPHeader ::
HTTPHeader
=
HTTPHeader' :: Maybe Text -> Maybe Text -> HTTPHeader
HTTPHeader'
{ $sel:value:HTTPHeader' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:HTTPHeader' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
hTTPHeader_value :: Lens.Lens' HTTPHeader (Prelude.Maybe Prelude.Text)
= (HTTPHeader -> Maybe Text)
-> (HTTPHeader -> Maybe Text -> HTTPHeader)
-> Lens HTTPHeader HTTPHeader (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HTTPHeader' {Maybe Text
value :: Maybe Text
$sel:value:HTTPHeader' :: HTTPHeader -> Maybe Text
value} -> Maybe Text
value) (\s :: HTTPHeader
s@HTTPHeader' {} Maybe Text
a -> HTTPHeader
s {$sel:value:HTTPHeader' :: Maybe Text
value = Maybe Text
a} :: HTTPHeader)
hTTPHeader_name :: Lens.Lens' HTTPHeader (Prelude.Maybe Prelude.Text)
= (HTTPHeader -> Maybe Text)
-> (HTTPHeader -> Maybe Text -> HTTPHeader)
-> Lens HTTPHeader HTTPHeader (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HTTPHeader' {Maybe Text
name :: Maybe Text
$sel:name:HTTPHeader' :: HTTPHeader -> Maybe Text
name} -> Maybe Text
name) (\s :: HTTPHeader
s@HTTPHeader' {} Maybe Text
a -> HTTPHeader
s {$sel:name:HTTPHeader' :: Maybe Text
name = Maybe Text
a} :: HTTPHeader)
instance Core.FromJSON HTTPHeader where
parseJSON :: Value -> Parser HTTPHeader
parseJSON =
String
-> (Object -> Parser HTTPHeader) -> Value -> Parser HTTPHeader
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HTTPHeader"
( \Object
x ->
Maybe Text -> Maybe Text -> HTTPHeader
HTTPHeader'
(Maybe Text -> Maybe Text -> HTTPHeader)
-> Parser (Maybe Text) -> Parser (Maybe Text -> HTTPHeader)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value") Parser (Maybe Text -> HTTPHeader)
-> Parser (Maybe Text) -> Parser HTTPHeader
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
)
instance Prelude.Hashable HTTPHeader
instance Prelude.NFData HTTPHeader