{-# 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.GlobalAccelerator.Types.EndpointConfiguration 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 EndpointConfiguration = EndpointConfiguration'
{
EndpointConfiguration -> Maybe Bool
clientIPPreservationEnabled :: Prelude.Maybe Prelude.Bool,
EndpointConfiguration -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text,
EndpointConfiguration -> Maybe Natural
weight :: Prelude.Maybe Prelude.Natural
}
deriving (EndpointConfiguration -> EndpointConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointConfiguration -> EndpointConfiguration -> Bool
$c/= :: EndpointConfiguration -> EndpointConfiguration -> Bool
== :: EndpointConfiguration -> EndpointConfiguration -> Bool
$c== :: EndpointConfiguration -> EndpointConfiguration -> Bool
Prelude.Eq, ReadPrec [EndpointConfiguration]
ReadPrec EndpointConfiguration
Int -> ReadS EndpointConfiguration
ReadS [EndpointConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointConfiguration]
$creadListPrec :: ReadPrec [EndpointConfiguration]
readPrec :: ReadPrec EndpointConfiguration
$creadPrec :: ReadPrec EndpointConfiguration
readList :: ReadS [EndpointConfiguration]
$creadList :: ReadS [EndpointConfiguration]
readsPrec :: Int -> ReadS EndpointConfiguration
$creadsPrec :: Int -> ReadS EndpointConfiguration
Prelude.Read, Int -> EndpointConfiguration -> ShowS
[EndpointConfiguration] -> ShowS
EndpointConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointConfiguration] -> ShowS
$cshowList :: [EndpointConfiguration] -> ShowS
show :: EndpointConfiguration -> String
$cshow :: EndpointConfiguration -> String
showsPrec :: Int -> EndpointConfiguration -> ShowS
$cshowsPrec :: Int -> EndpointConfiguration -> ShowS
Prelude.Show, forall x. Rep EndpointConfiguration x -> EndpointConfiguration
forall x. EndpointConfiguration -> Rep EndpointConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointConfiguration x -> EndpointConfiguration
$cfrom :: forall x. EndpointConfiguration -> Rep EndpointConfiguration x
Prelude.Generic)
newEndpointConfiguration ::
EndpointConfiguration
newEndpointConfiguration :: EndpointConfiguration
newEndpointConfiguration =
EndpointConfiguration'
{ $sel:clientIPPreservationEnabled:EndpointConfiguration' :: Maybe Bool
clientIPPreservationEnabled =
forall a. Maybe a
Prelude.Nothing,
$sel:endpointId:EndpointConfiguration' :: Maybe Text
endpointId = forall a. Maybe a
Prelude.Nothing,
$sel:weight:EndpointConfiguration' :: Maybe Natural
weight = forall a. Maybe a
Prelude.Nothing
}
endpointConfiguration_clientIPPreservationEnabled :: Lens.Lens' EndpointConfiguration (Prelude.Maybe Prelude.Bool)
endpointConfiguration_clientIPPreservationEnabled :: Lens' EndpointConfiguration (Maybe Bool)
endpointConfiguration_clientIPPreservationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointConfiguration' {Maybe Bool
clientIPPreservationEnabled :: Maybe Bool
$sel:clientIPPreservationEnabled:EndpointConfiguration' :: EndpointConfiguration -> Maybe Bool
clientIPPreservationEnabled} -> Maybe Bool
clientIPPreservationEnabled) (\s :: EndpointConfiguration
s@EndpointConfiguration' {} Maybe Bool
a -> EndpointConfiguration
s {$sel:clientIPPreservationEnabled:EndpointConfiguration' :: Maybe Bool
clientIPPreservationEnabled = Maybe Bool
a} :: EndpointConfiguration)
endpointConfiguration_endpointId :: Lens.Lens' EndpointConfiguration (Prelude.Maybe Prelude.Text)
endpointConfiguration_endpointId :: Lens' EndpointConfiguration (Maybe Text)
endpointConfiguration_endpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointConfiguration' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:EndpointConfiguration' :: EndpointConfiguration -> Maybe Text
endpointId} -> Maybe Text
endpointId) (\s :: EndpointConfiguration
s@EndpointConfiguration' {} Maybe Text
a -> EndpointConfiguration
s {$sel:endpointId:EndpointConfiguration' :: Maybe Text
endpointId = Maybe Text
a} :: EndpointConfiguration)
endpointConfiguration_weight :: Lens.Lens' EndpointConfiguration (Prelude.Maybe Prelude.Natural)
endpointConfiguration_weight :: Lens' EndpointConfiguration (Maybe Natural)
endpointConfiguration_weight = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointConfiguration' {Maybe Natural
weight :: Maybe Natural
$sel:weight:EndpointConfiguration' :: EndpointConfiguration -> Maybe Natural
weight} -> Maybe Natural
weight) (\s :: EndpointConfiguration
s@EndpointConfiguration' {} Maybe Natural
a -> EndpointConfiguration
s {$sel:weight:EndpointConfiguration' :: Maybe Natural
weight = Maybe Natural
a} :: EndpointConfiguration)
instance Prelude.Hashable EndpointConfiguration where
hashWithSalt :: Int -> EndpointConfiguration -> Int
hashWithSalt Int
_salt EndpointConfiguration' {Maybe Bool
Maybe Natural
Maybe Text
weight :: Maybe Natural
endpointId :: Maybe Text
clientIPPreservationEnabled :: Maybe Bool
$sel:weight:EndpointConfiguration' :: EndpointConfiguration -> Maybe Natural
$sel:endpointId:EndpointConfiguration' :: EndpointConfiguration -> Maybe Text
$sel:clientIPPreservationEnabled:EndpointConfiguration' :: EndpointConfiguration -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
clientIPPreservationEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
weight
instance Prelude.NFData EndpointConfiguration where
rnf :: EndpointConfiguration -> ()
rnf EndpointConfiguration' {Maybe Bool
Maybe Natural
Maybe Text
weight :: Maybe Natural
endpointId :: Maybe Text
clientIPPreservationEnabled :: Maybe Bool
$sel:weight:EndpointConfiguration' :: EndpointConfiguration -> Maybe Natural
$sel:endpointId:EndpointConfiguration' :: EndpointConfiguration -> Maybe Text
$sel:clientIPPreservationEnabled:EndpointConfiguration' :: EndpointConfiguration -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
clientIPPreservationEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
weight
instance Data.ToJSON EndpointConfiguration where
toJSON :: EndpointConfiguration -> Value
toJSON EndpointConfiguration' {Maybe Bool
Maybe Natural
Maybe Text
weight :: Maybe Natural
endpointId :: Maybe Text
clientIPPreservationEnabled :: Maybe Bool
$sel:weight:EndpointConfiguration' :: EndpointConfiguration -> Maybe Natural
$sel:endpointId:EndpointConfiguration' :: EndpointConfiguration -> Maybe Text
$sel:clientIPPreservationEnabled:EndpointConfiguration' :: EndpointConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ClientIPPreservationEnabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
clientIPPreservationEnabled,
(Key
"EndpointId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
endpointId,
(Key
"Weight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
weight
]
)