{-# 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.EndpointDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GlobalAccelerator.Types.HealthState
import qualified Amazonka.Prelude as Prelude
data EndpointDescription = EndpointDescription'
{
EndpointDescription -> Maybe Bool
clientIPPreservationEnabled :: Prelude.Maybe Prelude.Bool,
EndpointDescription -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text,
EndpointDescription -> Maybe Text
healthReason :: Prelude.Maybe Prelude.Text,
EndpointDescription -> Maybe HealthState
healthState :: Prelude.Maybe HealthState,
EndpointDescription -> Maybe Natural
weight :: Prelude.Maybe Prelude.Natural
}
deriving (EndpointDescription -> EndpointDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointDescription -> EndpointDescription -> Bool
$c/= :: EndpointDescription -> EndpointDescription -> Bool
== :: EndpointDescription -> EndpointDescription -> Bool
$c== :: EndpointDescription -> EndpointDescription -> Bool
Prelude.Eq, ReadPrec [EndpointDescription]
ReadPrec EndpointDescription
Int -> ReadS EndpointDescription
ReadS [EndpointDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointDescription]
$creadListPrec :: ReadPrec [EndpointDescription]
readPrec :: ReadPrec EndpointDescription
$creadPrec :: ReadPrec EndpointDescription
readList :: ReadS [EndpointDescription]
$creadList :: ReadS [EndpointDescription]
readsPrec :: Int -> ReadS EndpointDescription
$creadsPrec :: Int -> ReadS EndpointDescription
Prelude.Read, Int -> EndpointDescription -> ShowS
[EndpointDescription] -> ShowS
EndpointDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointDescription] -> ShowS
$cshowList :: [EndpointDescription] -> ShowS
show :: EndpointDescription -> String
$cshow :: EndpointDescription -> String
showsPrec :: Int -> EndpointDescription -> ShowS
$cshowsPrec :: Int -> EndpointDescription -> ShowS
Prelude.Show, forall x. Rep EndpointDescription x -> EndpointDescription
forall x. EndpointDescription -> Rep EndpointDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointDescription x -> EndpointDescription
$cfrom :: forall x. EndpointDescription -> Rep EndpointDescription x
Prelude.Generic)
newEndpointDescription ::
EndpointDescription
newEndpointDescription :: EndpointDescription
newEndpointDescription =
EndpointDescription'
{ $sel:clientIPPreservationEnabled:EndpointDescription' :: Maybe Bool
clientIPPreservationEnabled =
forall a. Maybe a
Prelude.Nothing,
$sel:endpointId:EndpointDescription' :: Maybe Text
endpointId = forall a. Maybe a
Prelude.Nothing,
$sel:healthReason:EndpointDescription' :: Maybe Text
healthReason = forall a. Maybe a
Prelude.Nothing,
$sel:healthState:EndpointDescription' :: Maybe HealthState
healthState = forall a. Maybe a
Prelude.Nothing,
$sel:weight:EndpointDescription' :: Maybe Natural
weight = forall a. Maybe a
Prelude.Nothing
}
endpointDescription_clientIPPreservationEnabled :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Bool)
endpointDescription_clientIPPreservationEnabled :: Lens' EndpointDescription (Maybe Bool)
endpointDescription_clientIPPreservationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDescription' {Maybe Bool
clientIPPreservationEnabled :: Maybe Bool
$sel:clientIPPreservationEnabled:EndpointDescription' :: EndpointDescription -> Maybe Bool
clientIPPreservationEnabled} -> Maybe Bool
clientIPPreservationEnabled) (\s :: EndpointDescription
s@EndpointDescription' {} Maybe Bool
a -> EndpointDescription
s {$sel:clientIPPreservationEnabled:EndpointDescription' :: Maybe Bool
clientIPPreservationEnabled = Maybe Bool
a} :: EndpointDescription)
endpointDescription_endpointId :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Text)
endpointDescription_endpointId :: Lens' EndpointDescription (Maybe Text)
endpointDescription_endpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDescription' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:EndpointDescription' :: EndpointDescription -> Maybe Text
endpointId} -> Maybe Text
endpointId) (\s :: EndpointDescription
s@EndpointDescription' {} Maybe Text
a -> EndpointDescription
s {$sel:endpointId:EndpointDescription' :: Maybe Text
endpointId = Maybe Text
a} :: EndpointDescription)
endpointDescription_healthReason :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Text)
endpointDescription_healthReason :: Lens' EndpointDescription (Maybe Text)
endpointDescription_healthReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDescription' {Maybe Text
healthReason :: Maybe Text
$sel:healthReason:EndpointDescription' :: EndpointDescription -> Maybe Text
healthReason} -> Maybe Text
healthReason) (\s :: EndpointDescription
s@EndpointDescription' {} Maybe Text
a -> EndpointDescription
s {$sel:healthReason:EndpointDescription' :: Maybe Text
healthReason = Maybe Text
a} :: EndpointDescription)
endpointDescription_healthState :: Lens.Lens' EndpointDescription (Prelude.Maybe HealthState)
endpointDescription_healthState :: Lens' EndpointDescription (Maybe HealthState)
endpointDescription_healthState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDescription' {Maybe HealthState
healthState :: Maybe HealthState
$sel:healthState:EndpointDescription' :: EndpointDescription -> Maybe HealthState
healthState} -> Maybe HealthState
healthState) (\s :: EndpointDescription
s@EndpointDescription' {} Maybe HealthState
a -> EndpointDescription
s {$sel:healthState:EndpointDescription' :: Maybe HealthState
healthState = Maybe HealthState
a} :: EndpointDescription)
endpointDescription_weight :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Natural)
endpointDescription_weight :: Lens' EndpointDescription (Maybe Natural)
endpointDescription_weight = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDescription' {Maybe Natural
weight :: Maybe Natural
$sel:weight:EndpointDescription' :: EndpointDescription -> Maybe Natural
weight} -> Maybe Natural
weight) (\s :: EndpointDescription
s@EndpointDescription' {} Maybe Natural
a -> EndpointDescription
s {$sel:weight:EndpointDescription' :: Maybe Natural
weight = Maybe Natural
a} :: EndpointDescription)
instance Data.FromJSON EndpointDescription where
parseJSON :: Value -> Parser EndpointDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EndpointDescription"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe HealthState
-> Maybe Natural
-> EndpointDescription
EndpointDescription'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ClientIPPreservationEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndpointId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HealthReason")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HealthState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Weight")
)
instance Prelude.Hashable EndpointDescription where
hashWithSalt :: Int -> EndpointDescription -> Int
hashWithSalt Int
_salt EndpointDescription' {Maybe Bool
Maybe Natural
Maybe Text
Maybe HealthState
weight :: Maybe Natural
healthState :: Maybe HealthState
healthReason :: Maybe Text
endpointId :: Maybe Text
clientIPPreservationEnabled :: Maybe Bool
$sel:weight:EndpointDescription' :: EndpointDescription -> Maybe Natural
$sel:healthState:EndpointDescription' :: EndpointDescription -> Maybe HealthState
$sel:healthReason:EndpointDescription' :: EndpointDescription -> Maybe Text
$sel:endpointId:EndpointDescription' :: EndpointDescription -> Maybe Text
$sel:clientIPPreservationEnabled:EndpointDescription' :: EndpointDescription -> 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 Text
healthReason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HealthState
healthState
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
weight
instance Prelude.NFData EndpointDescription where
rnf :: EndpointDescription -> ()
rnf EndpointDescription' {Maybe Bool
Maybe Natural
Maybe Text
Maybe HealthState
weight :: Maybe Natural
healthState :: Maybe HealthState
healthReason :: Maybe Text
endpointId :: Maybe Text
clientIPPreservationEnabled :: Maybe Bool
$sel:weight:EndpointDescription' :: EndpointDescription -> Maybe Natural
$sel:healthState:EndpointDescription' :: EndpointDescription -> Maybe HealthState
$sel:healthReason:EndpointDescription' :: EndpointDescription -> Maybe Text
$sel:endpointId:EndpointDescription' :: EndpointDescription -> Maybe Text
$sel:clientIPPreservationEnabled:EndpointDescription' :: EndpointDescription -> 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 Text
healthReason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HealthState
healthState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
weight