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