{-# 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.HttpRequestMethodConditionConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HttpRequestMethodConditionConfig = HttpRequestMethodConditionConfig'
{
HttpRequestMethodConditionConfig -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text]
}
deriving (HttpRequestMethodConditionConfig
-> HttpRequestMethodConditionConfig -> Bool
(HttpRequestMethodConditionConfig
-> HttpRequestMethodConditionConfig -> Bool)
-> (HttpRequestMethodConditionConfig
-> HttpRequestMethodConditionConfig -> Bool)
-> Eq HttpRequestMethodConditionConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpRequestMethodConditionConfig
-> HttpRequestMethodConditionConfig -> Bool
$c/= :: HttpRequestMethodConditionConfig
-> HttpRequestMethodConditionConfig -> Bool
== :: HttpRequestMethodConditionConfig
-> HttpRequestMethodConditionConfig -> Bool
$c== :: HttpRequestMethodConditionConfig
-> HttpRequestMethodConditionConfig -> Bool
Prelude.Eq, ReadPrec [HttpRequestMethodConditionConfig]
ReadPrec HttpRequestMethodConditionConfig
Int -> ReadS HttpRequestMethodConditionConfig
ReadS [HttpRequestMethodConditionConfig]
(Int -> ReadS HttpRequestMethodConditionConfig)
-> ReadS [HttpRequestMethodConditionConfig]
-> ReadPrec HttpRequestMethodConditionConfig
-> ReadPrec [HttpRequestMethodConditionConfig]
-> Read HttpRequestMethodConditionConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HttpRequestMethodConditionConfig]
$creadListPrec :: ReadPrec [HttpRequestMethodConditionConfig]
readPrec :: ReadPrec HttpRequestMethodConditionConfig
$creadPrec :: ReadPrec HttpRequestMethodConditionConfig
readList :: ReadS [HttpRequestMethodConditionConfig]
$creadList :: ReadS [HttpRequestMethodConditionConfig]
readsPrec :: Int -> ReadS HttpRequestMethodConditionConfig
$creadsPrec :: Int -> ReadS HttpRequestMethodConditionConfig
Prelude.Read, Int -> HttpRequestMethodConditionConfig -> ShowS
[HttpRequestMethodConditionConfig] -> ShowS
HttpRequestMethodConditionConfig -> String
(Int -> HttpRequestMethodConditionConfig -> ShowS)
-> (HttpRequestMethodConditionConfig -> String)
-> ([HttpRequestMethodConditionConfig] -> ShowS)
-> Show HttpRequestMethodConditionConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpRequestMethodConditionConfig] -> ShowS
$cshowList :: [HttpRequestMethodConditionConfig] -> ShowS
show :: HttpRequestMethodConditionConfig -> String
$cshow :: HttpRequestMethodConditionConfig -> String
showsPrec :: Int -> HttpRequestMethodConditionConfig -> ShowS
$cshowsPrec :: Int -> HttpRequestMethodConditionConfig -> ShowS
Prelude.Show, (forall x.
HttpRequestMethodConditionConfig
-> Rep HttpRequestMethodConditionConfig x)
-> (forall x.
Rep HttpRequestMethodConditionConfig x
-> HttpRequestMethodConditionConfig)
-> Generic HttpRequestMethodConditionConfig
forall x.
Rep HttpRequestMethodConditionConfig x
-> HttpRequestMethodConditionConfig
forall x.
HttpRequestMethodConditionConfig
-> Rep HttpRequestMethodConditionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HttpRequestMethodConditionConfig x
-> HttpRequestMethodConditionConfig
$cfrom :: forall x.
HttpRequestMethodConditionConfig
-> Rep HttpRequestMethodConditionConfig x
Prelude.Generic)
newHttpRequestMethodConditionConfig ::
HttpRequestMethodConditionConfig
newHttpRequestMethodConditionConfig :: HttpRequestMethodConditionConfig
newHttpRequestMethodConditionConfig =
HttpRequestMethodConditionConfig' :: Maybe [Text] -> HttpRequestMethodConditionConfig
HttpRequestMethodConditionConfig'
{ $sel:values:HttpRequestMethodConditionConfig' :: Maybe [Text]
values =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
httpRequestMethodConditionConfig_values :: Lens.Lens' HttpRequestMethodConditionConfig (Prelude.Maybe [Prelude.Text])
httpRequestMethodConditionConfig_values :: (Maybe [Text] -> f (Maybe [Text]))
-> HttpRequestMethodConditionConfig
-> f HttpRequestMethodConditionConfig
httpRequestMethodConditionConfig_values = (HttpRequestMethodConditionConfig -> Maybe [Text])
-> (HttpRequestMethodConditionConfig
-> Maybe [Text] -> HttpRequestMethodConditionConfig)
-> Lens
HttpRequestMethodConditionConfig
HttpRequestMethodConditionConfig
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpRequestMethodConditionConfig' {Maybe [Text]
values :: Maybe [Text]
$sel:values:HttpRequestMethodConditionConfig' :: HttpRequestMethodConditionConfig -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: HttpRequestMethodConditionConfig
s@HttpRequestMethodConditionConfig' {} Maybe [Text]
a -> HttpRequestMethodConditionConfig
s {$sel:values:HttpRequestMethodConditionConfig' :: Maybe [Text]
values = Maybe [Text]
a} :: HttpRequestMethodConditionConfig) ((Maybe [Text] -> f (Maybe [Text]))
-> HttpRequestMethodConditionConfig
-> f HttpRequestMethodConditionConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> HttpRequestMethodConditionConfig
-> f HttpRequestMethodConditionConfig
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
instance
Core.FromXML
HttpRequestMethodConditionConfig
where
parseXML :: [Node] -> Either String HttpRequestMethodConditionConfig
parseXML [Node]
x =
Maybe [Text] -> HttpRequestMethodConditionConfig
HttpRequestMethodConditionConfig'
(Maybe [Text] -> HttpRequestMethodConditionConfig)
-> Either String (Maybe [Text])
-> Either String HttpRequestMethodConditionConfig
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 [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")
)
instance
Prelude.Hashable
HttpRequestMethodConditionConfig
instance
Prelude.NFData
HttpRequestMethodConditionConfig
instance
Core.ToQuery
HttpRequestMethodConditionConfig
where
toQuery :: HttpRequestMethodConditionConfig -> QueryString
toQuery HttpRequestMethodConditionConfig' {Maybe [Text]
values :: Maybe [Text]
$sel:values:HttpRequestMethodConditionConfig' :: HttpRequestMethodConditionConfig -> Maybe [Text]
..} =
[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 -> [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)
]