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