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