{-# 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.OriginRequestPolicyQueryStringsConfig where
import Amazonka.CloudFront.Types.OriginRequestPolicyQueryStringBehavior
import Amazonka.CloudFront.Types.QueryStringNames
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OriginRequestPolicyQueryStringsConfig = OriginRequestPolicyQueryStringsConfig'
{
OriginRequestPolicyQueryStringsConfig -> Maybe QueryStringNames
queryStrings :: Prelude.Maybe QueryStringNames,
OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringBehavior
queryStringBehavior :: OriginRequestPolicyQueryStringBehavior
}
deriving (OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringsConfig -> Bool
(OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringsConfig -> Bool)
-> (OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringsConfig -> Bool)
-> Eq OriginRequestPolicyQueryStringsConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringsConfig -> Bool
$c/= :: OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringsConfig -> Bool
== :: OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringsConfig -> Bool
$c== :: OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringsConfig -> Bool
Prelude.Eq, ReadPrec [OriginRequestPolicyQueryStringsConfig]
ReadPrec OriginRequestPolicyQueryStringsConfig
Int -> ReadS OriginRequestPolicyQueryStringsConfig
ReadS [OriginRequestPolicyQueryStringsConfig]
(Int -> ReadS OriginRequestPolicyQueryStringsConfig)
-> ReadS [OriginRequestPolicyQueryStringsConfig]
-> ReadPrec OriginRequestPolicyQueryStringsConfig
-> ReadPrec [OriginRequestPolicyQueryStringsConfig]
-> Read OriginRequestPolicyQueryStringsConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OriginRequestPolicyQueryStringsConfig]
$creadListPrec :: ReadPrec [OriginRequestPolicyQueryStringsConfig]
readPrec :: ReadPrec OriginRequestPolicyQueryStringsConfig
$creadPrec :: ReadPrec OriginRequestPolicyQueryStringsConfig
readList :: ReadS [OriginRequestPolicyQueryStringsConfig]
$creadList :: ReadS [OriginRequestPolicyQueryStringsConfig]
readsPrec :: Int -> ReadS OriginRequestPolicyQueryStringsConfig
$creadsPrec :: Int -> ReadS OriginRequestPolicyQueryStringsConfig
Prelude.Read, Int -> OriginRequestPolicyQueryStringsConfig -> ShowS
[OriginRequestPolicyQueryStringsConfig] -> ShowS
OriginRequestPolicyQueryStringsConfig -> String
(Int -> OriginRequestPolicyQueryStringsConfig -> ShowS)
-> (OriginRequestPolicyQueryStringsConfig -> String)
-> ([OriginRequestPolicyQueryStringsConfig] -> ShowS)
-> Show OriginRequestPolicyQueryStringsConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OriginRequestPolicyQueryStringsConfig] -> ShowS
$cshowList :: [OriginRequestPolicyQueryStringsConfig] -> ShowS
show :: OriginRequestPolicyQueryStringsConfig -> String
$cshow :: OriginRequestPolicyQueryStringsConfig -> String
showsPrec :: Int -> OriginRequestPolicyQueryStringsConfig -> ShowS
$cshowsPrec :: Int -> OriginRequestPolicyQueryStringsConfig -> ShowS
Prelude.Show, (forall x.
OriginRequestPolicyQueryStringsConfig
-> Rep OriginRequestPolicyQueryStringsConfig x)
-> (forall x.
Rep OriginRequestPolicyQueryStringsConfig x
-> OriginRequestPolicyQueryStringsConfig)
-> Generic OriginRequestPolicyQueryStringsConfig
forall x.
Rep OriginRequestPolicyQueryStringsConfig x
-> OriginRequestPolicyQueryStringsConfig
forall x.
OriginRequestPolicyQueryStringsConfig
-> Rep OriginRequestPolicyQueryStringsConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OriginRequestPolicyQueryStringsConfig x
-> OriginRequestPolicyQueryStringsConfig
$cfrom :: forall x.
OriginRequestPolicyQueryStringsConfig
-> Rep OriginRequestPolicyQueryStringsConfig x
Prelude.Generic)
newOriginRequestPolicyQueryStringsConfig ::
OriginRequestPolicyQueryStringBehavior ->
OriginRequestPolicyQueryStringsConfig
newOriginRequestPolicyQueryStringsConfig :: OriginRequestPolicyQueryStringBehavior
-> OriginRequestPolicyQueryStringsConfig
newOriginRequestPolicyQueryStringsConfig
OriginRequestPolicyQueryStringBehavior
pQueryStringBehavior_ =
OriginRequestPolicyQueryStringsConfig' :: Maybe QueryStringNames
-> OriginRequestPolicyQueryStringBehavior
-> OriginRequestPolicyQueryStringsConfig
OriginRequestPolicyQueryStringsConfig'
{ $sel:queryStrings:OriginRequestPolicyQueryStringsConfig' :: Maybe QueryStringNames
queryStrings =
Maybe QueryStringNames
forall a. Maybe a
Prelude.Nothing,
$sel:queryStringBehavior:OriginRequestPolicyQueryStringsConfig' :: OriginRequestPolicyQueryStringBehavior
queryStringBehavior =
OriginRequestPolicyQueryStringBehavior
pQueryStringBehavior_
}
originRequestPolicyQueryStringsConfig_queryStrings :: Lens.Lens' OriginRequestPolicyQueryStringsConfig (Prelude.Maybe QueryStringNames)
originRequestPolicyQueryStringsConfig_queryStrings :: (Maybe QueryStringNames -> f (Maybe QueryStringNames))
-> OriginRequestPolicyQueryStringsConfig
-> f OriginRequestPolicyQueryStringsConfig
originRequestPolicyQueryStringsConfig_queryStrings = (OriginRequestPolicyQueryStringsConfig -> Maybe QueryStringNames)
-> (OriginRequestPolicyQueryStringsConfig
-> Maybe QueryStringNames -> OriginRequestPolicyQueryStringsConfig)
-> Lens
OriginRequestPolicyQueryStringsConfig
OriginRequestPolicyQueryStringsConfig
(Maybe QueryStringNames)
(Maybe QueryStringNames)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OriginRequestPolicyQueryStringsConfig' {Maybe QueryStringNames
queryStrings :: Maybe QueryStringNames
$sel:queryStrings:OriginRequestPolicyQueryStringsConfig' :: OriginRequestPolicyQueryStringsConfig -> Maybe QueryStringNames
queryStrings} -> Maybe QueryStringNames
queryStrings) (\s :: OriginRequestPolicyQueryStringsConfig
s@OriginRequestPolicyQueryStringsConfig' {} Maybe QueryStringNames
a -> OriginRequestPolicyQueryStringsConfig
s {$sel:queryStrings:OriginRequestPolicyQueryStringsConfig' :: Maybe QueryStringNames
queryStrings = Maybe QueryStringNames
a} :: OriginRequestPolicyQueryStringsConfig)
originRequestPolicyQueryStringsConfig_queryStringBehavior :: Lens.Lens' OriginRequestPolicyQueryStringsConfig OriginRequestPolicyQueryStringBehavior
originRequestPolicyQueryStringsConfig_queryStringBehavior :: (OriginRequestPolicyQueryStringBehavior
-> f OriginRequestPolicyQueryStringBehavior)
-> OriginRequestPolicyQueryStringsConfig
-> f OriginRequestPolicyQueryStringsConfig
originRequestPolicyQueryStringsConfig_queryStringBehavior = (OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringBehavior)
-> (OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringBehavior
-> OriginRequestPolicyQueryStringsConfig)
-> Lens
OriginRequestPolicyQueryStringsConfig
OriginRequestPolicyQueryStringsConfig
OriginRequestPolicyQueryStringBehavior
OriginRequestPolicyQueryStringBehavior
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OriginRequestPolicyQueryStringsConfig' {OriginRequestPolicyQueryStringBehavior
queryStringBehavior :: OriginRequestPolicyQueryStringBehavior
$sel:queryStringBehavior:OriginRequestPolicyQueryStringsConfig' :: OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringBehavior
queryStringBehavior} -> OriginRequestPolicyQueryStringBehavior
queryStringBehavior) (\s :: OriginRequestPolicyQueryStringsConfig
s@OriginRequestPolicyQueryStringsConfig' {} OriginRequestPolicyQueryStringBehavior
a -> OriginRequestPolicyQueryStringsConfig
s {$sel:queryStringBehavior:OriginRequestPolicyQueryStringsConfig' :: OriginRequestPolicyQueryStringBehavior
queryStringBehavior = OriginRequestPolicyQueryStringBehavior
a} :: OriginRequestPolicyQueryStringsConfig)
instance
Core.FromXML
OriginRequestPolicyQueryStringsConfig
where
parseXML :: [Node] -> Either String OriginRequestPolicyQueryStringsConfig
parseXML [Node]
x =
Maybe QueryStringNames
-> OriginRequestPolicyQueryStringBehavior
-> OriginRequestPolicyQueryStringsConfig
OriginRequestPolicyQueryStringsConfig'
(Maybe QueryStringNames
-> OriginRequestPolicyQueryStringBehavior
-> OriginRequestPolicyQueryStringsConfig)
-> Either String (Maybe QueryStringNames)
-> Either
String
(OriginRequestPolicyQueryStringBehavior
-> OriginRequestPolicyQueryStringsConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe QueryStringNames)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"QueryStrings")
Either
String
(OriginRequestPolicyQueryStringBehavior
-> OriginRequestPolicyQueryStringsConfig)
-> Either String OriginRequestPolicyQueryStringBehavior
-> Either String OriginRequestPolicyQueryStringsConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String OriginRequestPolicyQueryStringBehavior
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"QueryStringBehavior")
instance
Prelude.Hashable
OriginRequestPolicyQueryStringsConfig
instance
Prelude.NFData
OriginRequestPolicyQueryStringsConfig
instance
Core.ToXML
OriginRequestPolicyQueryStringsConfig
where
toXML :: OriginRequestPolicyQueryStringsConfig -> XML
toXML OriginRequestPolicyQueryStringsConfig' {Maybe QueryStringNames
OriginRequestPolicyQueryStringBehavior
queryStringBehavior :: OriginRequestPolicyQueryStringBehavior
queryStrings :: Maybe QueryStringNames
$sel:queryStringBehavior:OriginRequestPolicyQueryStringsConfig' :: OriginRequestPolicyQueryStringsConfig
-> OriginRequestPolicyQueryStringBehavior
$sel:queryStrings:OriginRequestPolicyQueryStringsConfig' :: OriginRequestPolicyQueryStringsConfig -> Maybe QueryStringNames
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"QueryStrings" Name -> Maybe QueryStringNames -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe QueryStringNames
queryStrings,
Name
"QueryStringBehavior" Name -> OriginRequestPolicyQueryStringBehavior -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= OriginRequestPolicyQueryStringBehavior
queryStringBehavior
]