{-# 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.ELBV2.Types.RuleCondition where
import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types.HostHeaderConditionConfig
import Amazonka.ELBV2.Types.HttpHeaderConditionConfig
import Amazonka.ELBV2.Types.HttpRequestMethodConditionConfig
import Amazonka.ELBV2.Types.PathPatternConditionConfig
import Amazonka.ELBV2.Types.QueryStringConditionConfig
import Amazonka.ELBV2.Types.SourceIpConditionConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RuleCondition = RuleCondition'
{
RuleCondition -> Maybe Text
field :: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe HttpHeaderConditionConfig,
:: Prelude.Maybe HostHeaderConditionConfig,
RuleCondition -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text],
RuleCondition -> Maybe SourceIpConditionConfig
sourceIpConfig :: Prelude.Maybe SourceIpConditionConfig,
RuleCondition -> Maybe HttpRequestMethodConditionConfig
httpRequestMethodConfig :: Prelude.Maybe HttpRequestMethodConditionConfig,
RuleCondition -> Maybe PathPatternConditionConfig
pathPatternConfig :: Prelude.Maybe PathPatternConditionConfig,
RuleCondition -> Maybe QueryStringConditionConfig
queryStringConfig :: Prelude.Maybe QueryStringConditionConfig
}
deriving (RuleCondition -> RuleCondition -> Bool
(RuleCondition -> RuleCondition -> Bool)
-> (RuleCondition -> RuleCondition -> Bool) -> Eq RuleCondition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleCondition -> RuleCondition -> Bool
$c/= :: RuleCondition -> RuleCondition -> Bool
== :: RuleCondition -> RuleCondition -> Bool
$c== :: RuleCondition -> RuleCondition -> Bool
Prelude.Eq, ReadPrec [RuleCondition]
ReadPrec RuleCondition
Int -> ReadS RuleCondition
ReadS [RuleCondition]
(Int -> ReadS RuleCondition)
-> ReadS [RuleCondition]
-> ReadPrec RuleCondition
-> ReadPrec [RuleCondition]
-> Read RuleCondition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleCondition]
$creadListPrec :: ReadPrec [RuleCondition]
readPrec :: ReadPrec RuleCondition
$creadPrec :: ReadPrec RuleCondition
readList :: ReadS [RuleCondition]
$creadList :: ReadS [RuleCondition]
readsPrec :: Int -> ReadS RuleCondition
$creadsPrec :: Int -> ReadS RuleCondition
Prelude.Read, Int -> RuleCondition -> ShowS
[RuleCondition] -> ShowS
RuleCondition -> String
(Int -> RuleCondition -> ShowS)
-> (RuleCondition -> String)
-> ([RuleCondition] -> ShowS)
-> Show RuleCondition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleCondition] -> ShowS
$cshowList :: [RuleCondition] -> ShowS
show :: RuleCondition -> String
$cshow :: RuleCondition -> String
showsPrec :: Int -> RuleCondition -> ShowS
$cshowsPrec :: Int -> RuleCondition -> ShowS
Prelude.Show, (forall x. RuleCondition -> Rep RuleCondition x)
-> (forall x. Rep RuleCondition x -> RuleCondition)
-> Generic RuleCondition
forall x. Rep RuleCondition x -> RuleCondition
forall x. RuleCondition -> Rep RuleCondition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleCondition x -> RuleCondition
$cfrom :: forall x. RuleCondition -> Rep RuleCondition x
Prelude.Generic)
newRuleCondition ::
RuleCondition
newRuleCondition :: RuleCondition
newRuleCondition =
RuleCondition' :: Maybe Text
-> Maybe HttpHeaderConditionConfig
-> Maybe HostHeaderConditionConfig
-> Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition
RuleCondition'
{ $sel:field:RuleCondition' :: Maybe Text
field = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpHeaderConfig:RuleCondition' :: Maybe HttpHeaderConditionConfig
httpHeaderConfig = Maybe HttpHeaderConditionConfig
forall a. Maybe a
Prelude.Nothing,
$sel:hostHeaderConfig:RuleCondition' :: Maybe HostHeaderConditionConfig
hostHeaderConfig = Maybe HostHeaderConditionConfig
forall a. Maybe a
Prelude.Nothing,
$sel:values:RuleCondition' :: Maybe [Text]
values = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:sourceIpConfig:RuleCondition' :: Maybe SourceIpConditionConfig
sourceIpConfig = Maybe SourceIpConditionConfig
forall a. Maybe a
Prelude.Nothing,
$sel:httpRequestMethodConfig:RuleCondition' :: Maybe HttpRequestMethodConditionConfig
httpRequestMethodConfig = Maybe HttpRequestMethodConditionConfig
forall a. Maybe a
Prelude.Nothing,
$sel:pathPatternConfig:RuleCondition' :: Maybe PathPatternConditionConfig
pathPatternConfig = Maybe PathPatternConditionConfig
forall a. Maybe a
Prelude.Nothing,
$sel:queryStringConfig:RuleCondition' :: Maybe QueryStringConditionConfig
queryStringConfig = Maybe QueryStringConditionConfig
forall a. Maybe a
Prelude.Nothing
}
ruleCondition_field :: Lens.Lens' RuleCondition (Prelude.Maybe Prelude.Text)
ruleCondition_field :: (Maybe Text -> f (Maybe Text)) -> RuleCondition -> f RuleCondition
ruleCondition_field = (RuleCondition -> Maybe Text)
-> (RuleCondition -> Maybe Text -> RuleCondition)
-> Lens RuleCondition RuleCondition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe Text
field :: Maybe Text
$sel:field:RuleCondition' :: RuleCondition -> Maybe Text
field} -> Maybe Text
field) (\s :: RuleCondition
s@RuleCondition' {} Maybe Text
a -> RuleCondition
s {$sel:field:RuleCondition' :: Maybe Text
field = Maybe Text
a} :: RuleCondition)
ruleCondition_httpHeaderConfig :: Lens.Lens' RuleCondition (Prelude.Maybe HttpHeaderConditionConfig)
= (RuleCondition -> Maybe HttpHeaderConditionConfig)
-> (RuleCondition
-> Maybe HttpHeaderConditionConfig -> RuleCondition)
-> Lens
RuleCondition
RuleCondition
(Maybe HttpHeaderConditionConfig)
(Maybe HttpHeaderConditionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe HttpHeaderConditionConfig
httpHeaderConfig :: Maybe HttpHeaderConditionConfig
$sel:httpHeaderConfig:RuleCondition' :: RuleCondition -> Maybe HttpHeaderConditionConfig
httpHeaderConfig} -> Maybe HttpHeaderConditionConfig
httpHeaderConfig) (\s :: RuleCondition
s@RuleCondition' {} Maybe HttpHeaderConditionConfig
a -> RuleCondition
s {$sel:httpHeaderConfig:RuleCondition' :: Maybe HttpHeaderConditionConfig
httpHeaderConfig = Maybe HttpHeaderConditionConfig
a} :: RuleCondition)
ruleCondition_hostHeaderConfig :: Lens.Lens' RuleCondition (Prelude.Maybe HostHeaderConditionConfig)
= (RuleCondition -> Maybe HostHeaderConditionConfig)
-> (RuleCondition
-> Maybe HostHeaderConditionConfig -> RuleCondition)
-> Lens
RuleCondition
RuleCondition
(Maybe HostHeaderConditionConfig)
(Maybe HostHeaderConditionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe HostHeaderConditionConfig
hostHeaderConfig :: Maybe HostHeaderConditionConfig
$sel:hostHeaderConfig:RuleCondition' :: RuleCondition -> Maybe HostHeaderConditionConfig
hostHeaderConfig} -> Maybe HostHeaderConditionConfig
hostHeaderConfig) (\s :: RuleCondition
s@RuleCondition' {} Maybe HostHeaderConditionConfig
a -> RuleCondition
s {$sel:hostHeaderConfig:RuleCondition' :: Maybe HostHeaderConditionConfig
hostHeaderConfig = Maybe HostHeaderConditionConfig
a} :: RuleCondition)
ruleCondition_values :: Lens.Lens' RuleCondition (Prelude.Maybe [Prelude.Text])
ruleCondition_values :: (Maybe [Text] -> f (Maybe [Text]))
-> RuleCondition -> f RuleCondition
ruleCondition_values = (RuleCondition -> Maybe [Text])
-> (RuleCondition -> Maybe [Text] -> RuleCondition)
-> Lens RuleCondition RuleCondition (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe [Text]
values :: Maybe [Text]
$sel:values:RuleCondition' :: RuleCondition -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: RuleCondition
s@RuleCondition' {} Maybe [Text]
a -> RuleCondition
s {$sel:values:RuleCondition' :: Maybe [Text]
values = Maybe [Text]
a} :: RuleCondition) ((Maybe [Text] -> f (Maybe [Text]))
-> RuleCondition -> f RuleCondition)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> RuleCondition
-> f RuleCondition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
ruleCondition_sourceIpConfig :: Lens.Lens' RuleCondition (Prelude.Maybe SourceIpConditionConfig)
ruleCondition_sourceIpConfig :: (Maybe SourceIpConditionConfig
-> f (Maybe SourceIpConditionConfig))
-> RuleCondition -> f RuleCondition
ruleCondition_sourceIpConfig = (RuleCondition -> Maybe SourceIpConditionConfig)
-> (RuleCondition
-> Maybe SourceIpConditionConfig -> RuleCondition)
-> Lens
RuleCondition
RuleCondition
(Maybe SourceIpConditionConfig)
(Maybe SourceIpConditionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe SourceIpConditionConfig
sourceIpConfig :: Maybe SourceIpConditionConfig
$sel:sourceIpConfig:RuleCondition' :: RuleCondition -> Maybe SourceIpConditionConfig
sourceIpConfig} -> Maybe SourceIpConditionConfig
sourceIpConfig) (\s :: RuleCondition
s@RuleCondition' {} Maybe SourceIpConditionConfig
a -> RuleCondition
s {$sel:sourceIpConfig:RuleCondition' :: Maybe SourceIpConditionConfig
sourceIpConfig = Maybe SourceIpConditionConfig
a} :: RuleCondition)
ruleCondition_httpRequestMethodConfig :: Lens.Lens' RuleCondition (Prelude.Maybe HttpRequestMethodConditionConfig)
ruleCondition_httpRequestMethodConfig :: (Maybe HttpRequestMethodConditionConfig
-> f (Maybe HttpRequestMethodConditionConfig))
-> RuleCondition -> f RuleCondition
ruleCondition_httpRequestMethodConfig = (RuleCondition -> Maybe HttpRequestMethodConditionConfig)
-> (RuleCondition
-> Maybe HttpRequestMethodConditionConfig -> RuleCondition)
-> Lens
RuleCondition
RuleCondition
(Maybe HttpRequestMethodConditionConfig)
(Maybe HttpRequestMethodConditionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe HttpRequestMethodConditionConfig
httpRequestMethodConfig :: Maybe HttpRequestMethodConditionConfig
$sel:httpRequestMethodConfig:RuleCondition' :: RuleCondition -> Maybe HttpRequestMethodConditionConfig
httpRequestMethodConfig} -> Maybe HttpRequestMethodConditionConfig
httpRequestMethodConfig) (\s :: RuleCondition
s@RuleCondition' {} Maybe HttpRequestMethodConditionConfig
a -> RuleCondition
s {$sel:httpRequestMethodConfig:RuleCondition' :: Maybe HttpRequestMethodConditionConfig
httpRequestMethodConfig = Maybe HttpRequestMethodConditionConfig
a} :: RuleCondition)
ruleCondition_pathPatternConfig :: Lens.Lens' RuleCondition (Prelude.Maybe PathPatternConditionConfig)
ruleCondition_pathPatternConfig :: (Maybe PathPatternConditionConfig
-> f (Maybe PathPatternConditionConfig))
-> RuleCondition -> f RuleCondition
ruleCondition_pathPatternConfig = (RuleCondition -> Maybe PathPatternConditionConfig)
-> (RuleCondition
-> Maybe PathPatternConditionConfig -> RuleCondition)
-> Lens
RuleCondition
RuleCondition
(Maybe PathPatternConditionConfig)
(Maybe PathPatternConditionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe PathPatternConditionConfig
pathPatternConfig :: Maybe PathPatternConditionConfig
$sel:pathPatternConfig:RuleCondition' :: RuleCondition -> Maybe PathPatternConditionConfig
pathPatternConfig} -> Maybe PathPatternConditionConfig
pathPatternConfig) (\s :: RuleCondition
s@RuleCondition' {} Maybe PathPatternConditionConfig
a -> RuleCondition
s {$sel:pathPatternConfig:RuleCondition' :: Maybe PathPatternConditionConfig
pathPatternConfig = Maybe PathPatternConditionConfig
a} :: RuleCondition)
ruleCondition_queryStringConfig :: Lens.Lens' RuleCondition (Prelude.Maybe QueryStringConditionConfig)
ruleCondition_queryStringConfig :: (Maybe QueryStringConditionConfig
-> f (Maybe QueryStringConditionConfig))
-> RuleCondition -> f RuleCondition
ruleCondition_queryStringConfig = (RuleCondition -> Maybe QueryStringConditionConfig)
-> (RuleCondition
-> Maybe QueryStringConditionConfig -> RuleCondition)
-> Lens
RuleCondition
RuleCondition
(Maybe QueryStringConditionConfig)
(Maybe QueryStringConditionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleCondition' {Maybe QueryStringConditionConfig
queryStringConfig :: Maybe QueryStringConditionConfig
$sel:queryStringConfig:RuleCondition' :: RuleCondition -> Maybe QueryStringConditionConfig
queryStringConfig} -> Maybe QueryStringConditionConfig
queryStringConfig) (\s :: RuleCondition
s@RuleCondition' {} Maybe QueryStringConditionConfig
a -> RuleCondition
s {$sel:queryStringConfig:RuleCondition' :: Maybe QueryStringConditionConfig
queryStringConfig = Maybe QueryStringConditionConfig
a} :: RuleCondition)
instance Core.FromXML RuleCondition where
parseXML :: [Node] -> Either String RuleCondition
parseXML [Node]
x =
Maybe Text
-> Maybe HttpHeaderConditionConfig
-> Maybe HostHeaderConditionConfig
-> Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition
RuleCondition'
(Maybe Text
-> Maybe HttpHeaderConditionConfig
-> Maybe HostHeaderConditionConfig
-> Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
-> Either String (Maybe Text)
-> Either
String
(Maybe HttpHeaderConditionConfig
-> Maybe HostHeaderConditionConfig
-> Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Field")
Either
String
(Maybe HttpHeaderConditionConfig
-> Maybe HostHeaderConditionConfig
-> Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
-> Either String (Maybe HttpHeaderConditionConfig)
-> Either
String
(Maybe HostHeaderConditionConfig
-> Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe HttpHeaderConditionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HttpHeaderConfig")
Either
String
(Maybe HostHeaderConditionConfig
-> Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
-> Either String (Maybe HostHeaderConditionConfig)
-> Either
String
(Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe HostHeaderConditionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HostHeaderConfig")
Either
String
(Maybe [Text]
-> Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
-> Either String (Maybe [Text])
-> Either
String
(Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Values" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe SourceIpConditionConfig
-> Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
-> Either String (Maybe SourceIpConditionConfig)
-> Either
String
(Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe SourceIpConditionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SourceIpConfig")
Either
String
(Maybe HttpRequestMethodConditionConfig
-> Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig
-> RuleCondition)
-> Either String (Maybe HttpRequestMethodConditionConfig)
-> Either
String
(Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig -> RuleCondition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe HttpRequestMethodConditionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HttpRequestMethodConfig")
Either
String
(Maybe PathPatternConditionConfig
-> Maybe QueryStringConditionConfig -> RuleCondition)
-> Either String (Maybe PathPatternConditionConfig)
-> Either
String (Maybe QueryStringConditionConfig -> RuleCondition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe PathPatternConditionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PathPatternConfig")
Either String (Maybe QueryStringConditionConfig -> RuleCondition)
-> Either String (Maybe QueryStringConditionConfig)
-> Either String RuleCondition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe QueryStringConditionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"QueryStringConfig")
instance Prelude.Hashable RuleCondition
instance Prelude.NFData RuleCondition
instance Core.ToQuery RuleCondition where
toQuery :: RuleCondition -> QueryString
toQuery RuleCondition' {Maybe [Text]
Maybe Text
Maybe HostHeaderConditionConfig
Maybe HttpHeaderConditionConfig
Maybe HttpRequestMethodConditionConfig
Maybe PathPatternConditionConfig
Maybe QueryStringConditionConfig
Maybe SourceIpConditionConfig
queryStringConfig :: Maybe QueryStringConditionConfig
pathPatternConfig :: Maybe PathPatternConditionConfig
httpRequestMethodConfig :: Maybe HttpRequestMethodConditionConfig
sourceIpConfig :: Maybe SourceIpConditionConfig
values :: Maybe [Text]
hostHeaderConfig :: Maybe HostHeaderConditionConfig
httpHeaderConfig :: Maybe HttpHeaderConditionConfig
field :: Maybe Text
$sel:queryStringConfig:RuleCondition' :: RuleCondition -> Maybe QueryStringConditionConfig
$sel:pathPatternConfig:RuleCondition' :: RuleCondition -> Maybe PathPatternConditionConfig
$sel:httpRequestMethodConfig:RuleCondition' :: RuleCondition -> Maybe HttpRequestMethodConditionConfig
$sel:sourceIpConfig:RuleCondition' :: RuleCondition -> Maybe SourceIpConditionConfig
$sel:values:RuleCondition' :: RuleCondition -> Maybe [Text]
$sel:hostHeaderConfig:RuleCondition' :: RuleCondition -> Maybe HostHeaderConditionConfig
$sel:httpHeaderConfig:RuleCondition' :: RuleCondition -> Maybe HttpHeaderConditionConfig
$sel:field:RuleCondition' :: RuleCondition -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Field" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
field,
ByteString
"HttpHeaderConfig" ByteString -> Maybe HttpHeaderConditionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe HttpHeaderConditionConfig
httpHeaderConfig,
ByteString
"HostHeaderConfig" ByteString -> Maybe HostHeaderConditionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe HostHeaderConditionConfig
hostHeaderConfig,
ByteString
"Values"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
values),
ByteString
"SourceIpConfig" ByteString -> Maybe SourceIpConditionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe SourceIpConditionConfig
sourceIpConfig,
ByteString
"HttpRequestMethodConfig"
ByteString -> Maybe HttpRequestMethodConditionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe HttpRequestMethodConditionConfig
httpRequestMethodConfig,
ByteString
"PathPatternConfig" ByteString -> Maybe PathPatternConditionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PathPatternConditionConfig
pathPatternConfig,
ByteString
"QueryStringConfig" ByteString -> Maybe QueryStringConditionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryStringConditionConfig
queryStringConfig
]