{-# 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 Amazonka.GlobalAccelerator.Types.HealthState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EndpointDescription = EndpointDescription'
{
EndpointDescription -> Maybe Text
healthReason :: Prelude.Maybe Prelude.Text,
EndpointDescription -> Maybe Natural
weight :: Prelude.Maybe Prelude.Natural,
EndpointDescription -> Maybe Bool
clientIPPreservationEnabled :: Prelude.Maybe Prelude.Bool,
EndpointDescription -> Maybe HealthState
healthState :: Prelude.Maybe HealthState,
EndpointDescription -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text
}
deriving (EndpointDescription -> EndpointDescription -> Bool
(EndpointDescription -> EndpointDescription -> Bool)
-> (EndpointDescription -> EndpointDescription -> Bool)
-> Eq EndpointDescription
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]
(Int -> ReadS EndpointDescription)
-> ReadS [EndpointDescription]
-> ReadPrec EndpointDescription
-> ReadPrec [EndpointDescription]
-> Read 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
(Int -> EndpointDescription -> ShowS)
-> (EndpointDescription -> String)
-> ([EndpointDescription] -> ShowS)
-> Show EndpointDescription
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. EndpointDescription -> Rep EndpointDescription x)
-> (forall x. Rep EndpointDescription x -> EndpointDescription)
-> Generic EndpointDescription
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' :: Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe HealthState
-> Maybe Text
-> EndpointDescription
EndpointDescription'
{ $sel:healthReason:EndpointDescription' :: Maybe Text
healthReason =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:weight:EndpointDescription' :: Maybe Natural
weight = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:clientIPPreservationEnabled:EndpointDescription' :: Maybe Bool
clientIPPreservationEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:healthState:EndpointDescription' :: Maybe HealthState
healthState = Maybe HealthState
forall a. Maybe a
Prelude.Nothing,
$sel:endpointId:EndpointDescription' :: Maybe Text
endpointId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
endpointDescription_healthReason :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Text)
endpointDescription_healthReason :: (Maybe Text -> f (Maybe Text))
-> EndpointDescription -> f EndpointDescription
endpointDescription_healthReason = (EndpointDescription -> Maybe Text)
-> (EndpointDescription -> Maybe Text -> EndpointDescription)
-> Lens
EndpointDescription EndpointDescription (Maybe Text) (Maybe Text)
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_weight :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Natural)
endpointDescription_weight :: (Maybe Natural -> f (Maybe Natural))
-> EndpointDescription -> f EndpointDescription
endpointDescription_weight = (EndpointDescription -> Maybe Natural)
-> (EndpointDescription -> Maybe Natural -> EndpointDescription)
-> Lens
EndpointDescription
EndpointDescription
(Maybe Natural)
(Maybe Natural)
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)
endpointDescription_clientIPPreservationEnabled :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Bool)
endpointDescription_clientIPPreservationEnabled :: (Maybe Bool -> f (Maybe Bool))
-> EndpointDescription -> f EndpointDescription
endpointDescription_clientIPPreservationEnabled = (EndpointDescription -> Maybe Bool)
-> (EndpointDescription -> Maybe Bool -> EndpointDescription)
-> Lens
EndpointDescription EndpointDescription (Maybe Bool) (Maybe Bool)
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_healthState :: Lens.Lens' EndpointDescription (Prelude.Maybe HealthState)
endpointDescription_healthState :: (Maybe HealthState -> f (Maybe HealthState))
-> EndpointDescription -> f EndpointDescription
endpointDescription_healthState = (EndpointDescription -> Maybe HealthState)
-> (EndpointDescription
-> Maybe HealthState -> EndpointDescription)
-> Lens
EndpointDescription
EndpointDescription
(Maybe HealthState)
(Maybe 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_endpointId :: Lens.Lens' EndpointDescription (Prelude.Maybe Prelude.Text)
endpointDescription_endpointId :: (Maybe Text -> f (Maybe Text))
-> EndpointDescription -> f EndpointDescription
endpointDescription_endpointId = (EndpointDescription -> Maybe Text)
-> (EndpointDescription -> Maybe Text -> EndpointDescription)
-> Lens
EndpointDescription EndpointDescription (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON EndpointDescription where
parseJSON :: Value -> Parser EndpointDescription
parseJSON =
String
-> (Object -> Parser EndpointDescription)
-> Value
-> Parser EndpointDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EndpointDescription"
( \Object
x ->
Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe HealthState
-> Maybe Text
-> EndpointDescription
EndpointDescription'
(Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe HealthState
-> Maybe Text
-> EndpointDescription)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural
-> Maybe Bool
-> Maybe HealthState
-> Maybe Text
-> EndpointDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HealthReason")
Parser
(Maybe Natural
-> Maybe Bool
-> Maybe HealthState
-> Maybe Text
-> EndpointDescription)
-> Parser (Maybe Natural)
-> Parser
(Maybe Bool
-> Maybe HealthState -> Maybe Text -> EndpointDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Weight")
Parser
(Maybe Bool
-> Maybe HealthState -> Maybe Text -> EndpointDescription)
-> Parser (Maybe Bool)
-> Parser (Maybe HealthState -> Maybe Text -> EndpointDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClientIPPreservationEnabled")
Parser (Maybe HealthState -> Maybe Text -> EndpointDescription)
-> Parser (Maybe HealthState)
-> Parser (Maybe Text -> EndpointDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HealthState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HealthState")
Parser (Maybe Text -> EndpointDescription)
-> Parser (Maybe Text) -> Parser EndpointDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointId")
)
instance Prelude.Hashable EndpointDescription
instance Prelude.NFData EndpointDescription