{-# 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.QueryStringConditionConfig where
import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types.QueryStringKeyValuePair
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data QueryStringConditionConfig = QueryStringConditionConfig'
{
QueryStringConditionConfig -> Maybe [QueryStringKeyValuePair]
values :: Prelude.Maybe [QueryStringKeyValuePair]
}
deriving (QueryStringConditionConfig -> QueryStringConditionConfig -> Bool
(QueryStringConditionConfig -> QueryStringConditionConfig -> Bool)
-> (QueryStringConditionConfig
-> QueryStringConditionConfig -> Bool)
-> Eq QueryStringConditionConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueryStringConditionConfig -> QueryStringConditionConfig -> Bool
$c/= :: QueryStringConditionConfig -> QueryStringConditionConfig -> Bool
== :: QueryStringConditionConfig -> QueryStringConditionConfig -> Bool
$c== :: QueryStringConditionConfig -> QueryStringConditionConfig -> Bool
Prelude.Eq, ReadPrec [QueryStringConditionConfig]
ReadPrec QueryStringConditionConfig
Int -> ReadS QueryStringConditionConfig
ReadS [QueryStringConditionConfig]
(Int -> ReadS QueryStringConditionConfig)
-> ReadS [QueryStringConditionConfig]
-> ReadPrec QueryStringConditionConfig
-> ReadPrec [QueryStringConditionConfig]
-> Read QueryStringConditionConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueryStringConditionConfig]
$creadListPrec :: ReadPrec [QueryStringConditionConfig]
readPrec :: ReadPrec QueryStringConditionConfig
$creadPrec :: ReadPrec QueryStringConditionConfig
readList :: ReadS [QueryStringConditionConfig]
$creadList :: ReadS [QueryStringConditionConfig]
readsPrec :: Int -> ReadS QueryStringConditionConfig
$creadsPrec :: Int -> ReadS QueryStringConditionConfig
Prelude.Read, Int -> QueryStringConditionConfig -> ShowS
[QueryStringConditionConfig] -> ShowS
QueryStringConditionConfig -> String
(Int -> QueryStringConditionConfig -> ShowS)
-> (QueryStringConditionConfig -> String)
-> ([QueryStringConditionConfig] -> ShowS)
-> Show QueryStringConditionConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueryStringConditionConfig] -> ShowS
$cshowList :: [QueryStringConditionConfig] -> ShowS
show :: QueryStringConditionConfig -> String
$cshow :: QueryStringConditionConfig -> String
showsPrec :: Int -> QueryStringConditionConfig -> ShowS
$cshowsPrec :: Int -> QueryStringConditionConfig -> ShowS
Prelude.Show, (forall x.
QueryStringConditionConfig -> Rep QueryStringConditionConfig x)
-> (forall x.
Rep QueryStringConditionConfig x -> QueryStringConditionConfig)
-> Generic QueryStringConditionConfig
forall x.
Rep QueryStringConditionConfig x -> QueryStringConditionConfig
forall x.
QueryStringConditionConfig -> Rep QueryStringConditionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep QueryStringConditionConfig x -> QueryStringConditionConfig
$cfrom :: forall x.
QueryStringConditionConfig -> Rep QueryStringConditionConfig x
Prelude.Generic)
newQueryStringConditionConfig ::
QueryStringConditionConfig
newQueryStringConditionConfig :: QueryStringConditionConfig
newQueryStringConditionConfig =
QueryStringConditionConfig' :: Maybe [QueryStringKeyValuePair] -> QueryStringConditionConfig
QueryStringConditionConfig'
{ $sel:values:QueryStringConditionConfig' :: Maybe [QueryStringKeyValuePair]
values =
Maybe [QueryStringKeyValuePair]
forall a. Maybe a
Prelude.Nothing
}
queryStringConditionConfig_values :: Lens.Lens' QueryStringConditionConfig (Prelude.Maybe [QueryStringKeyValuePair])
queryStringConditionConfig_values :: (Maybe [QueryStringKeyValuePair]
-> f (Maybe [QueryStringKeyValuePair]))
-> QueryStringConditionConfig -> f QueryStringConditionConfig
queryStringConditionConfig_values = (QueryStringConditionConfig -> Maybe [QueryStringKeyValuePair])
-> (QueryStringConditionConfig
-> Maybe [QueryStringKeyValuePair] -> QueryStringConditionConfig)
-> Lens
QueryStringConditionConfig
QueryStringConditionConfig
(Maybe [QueryStringKeyValuePair])
(Maybe [QueryStringKeyValuePair])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryStringConditionConfig' {Maybe [QueryStringKeyValuePair]
values :: Maybe [QueryStringKeyValuePair]
$sel:values:QueryStringConditionConfig' :: QueryStringConditionConfig -> Maybe [QueryStringKeyValuePair]
values} -> Maybe [QueryStringKeyValuePair]
values) (\s :: QueryStringConditionConfig
s@QueryStringConditionConfig' {} Maybe [QueryStringKeyValuePair]
a -> QueryStringConditionConfig
s {$sel:values:QueryStringConditionConfig' :: Maybe [QueryStringKeyValuePair]
values = Maybe [QueryStringKeyValuePair]
a} :: QueryStringConditionConfig) ((Maybe [QueryStringKeyValuePair]
-> f (Maybe [QueryStringKeyValuePair]))
-> QueryStringConditionConfig -> f QueryStringConditionConfig)
-> ((Maybe [QueryStringKeyValuePair]
-> f (Maybe [QueryStringKeyValuePair]))
-> Maybe [QueryStringKeyValuePair]
-> f (Maybe [QueryStringKeyValuePair]))
-> (Maybe [QueryStringKeyValuePair]
-> f (Maybe [QueryStringKeyValuePair]))
-> QueryStringConditionConfig
-> f QueryStringConditionConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[QueryStringKeyValuePair]
[QueryStringKeyValuePair]
[QueryStringKeyValuePair]
[QueryStringKeyValuePair]
-> Iso
(Maybe [QueryStringKeyValuePair])
(Maybe [QueryStringKeyValuePair])
(Maybe [QueryStringKeyValuePair])
(Maybe [QueryStringKeyValuePair])
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
[QueryStringKeyValuePair]
[QueryStringKeyValuePair]
[QueryStringKeyValuePair]
[QueryStringKeyValuePair]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromXML QueryStringConditionConfig where
parseXML :: [Node] -> Either String QueryStringConditionConfig
parseXML [Node]
x =
Maybe [QueryStringKeyValuePair] -> QueryStringConditionConfig
QueryStringConditionConfig'
(Maybe [QueryStringKeyValuePair] -> QueryStringConditionConfig)
-> Either String (Maybe [QueryStringKeyValuePair])
-> Either String QueryStringConditionConfig
forall (f :: * -> *) a b. Functor 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 [QueryStringKeyValuePair]))
-> Either String (Maybe [QueryStringKeyValuePair])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [QueryStringKeyValuePair])
-> [Node] -> Either String (Maybe [QueryStringKeyValuePair])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [QueryStringKeyValuePair]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
instance Prelude.Hashable QueryStringConditionConfig
instance Prelude.NFData QueryStringConditionConfig
instance Core.ToQuery QueryStringConditionConfig where
toQuery :: QueryStringConditionConfig -> QueryString
toQuery QueryStringConditionConfig' {Maybe [QueryStringKeyValuePair]
values :: Maybe [QueryStringKeyValuePair]
$sel:values:QueryStringConditionConfig' :: QueryStringConditionConfig -> Maybe [QueryStringKeyValuePair]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 -> [QueryStringKeyValuePair] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([QueryStringKeyValuePair] -> QueryString)
-> Maybe [QueryStringKeyValuePair] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [QueryStringKeyValuePair]
values)
]