{-# 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.EndpointIdentifier 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 EndpointIdentifier = EndpointIdentifier'
{
EndpointIdentifier -> Maybe Bool
clientIPPreservationEnabled :: Prelude.Maybe Prelude.Bool,
EndpointIdentifier -> Text
endpointId :: Prelude.Text
}
deriving (EndpointIdentifier -> EndpointIdentifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointIdentifier -> EndpointIdentifier -> Bool
$c/= :: EndpointIdentifier -> EndpointIdentifier -> Bool
== :: EndpointIdentifier -> EndpointIdentifier -> Bool
$c== :: EndpointIdentifier -> EndpointIdentifier -> Bool
Prelude.Eq, ReadPrec [EndpointIdentifier]
ReadPrec EndpointIdentifier
Int -> ReadS EndpointIdentifier
ReadS [EndpointIdentifier]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointIdentifier]
$creadListPrec :: ReadPrec [EndpointIdentifier]
readPrec :: ReadPrec EndpointIdentifier
$creadPrec :: ReadPrec EndpointIdentifier
readList :: ReadS [EndpointIdentifier]
$creadList :: ReadS [EndpointIdentifier]
readsPrec :: Int -> ReadS EndpointIdentifier
$creadsPrec :: Int -> ReadS EndpointIdentifier
Prelude.Read, Int -> EndpointIdentifier -> ShowS
[EndpointIdentifier] -> ShowS
EndpointIdentifier -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointIdentifier] -> ShowS
$cshowList :: [EndpointIdentifier] -> ShowS
show :: EndpointIdentifier -> String
$cshow :: EndpointIdentifier -> String
showsPrec :: Int -> EndpointIdentifier -> ShowS
$cshowsPrec :: Int -> EndpointIdentifier -> ShowS
Prelude.Show, forall x. Rep EndpointIdentifier x -> EndpointIdentifier
forall x. EndpointIdentifier -> Rep EndpointIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointIdentifier x -> EndpointIdentifier
$cfrom :: forall x. EndpointIdentifier -> Rep EndpointIdentifier x
Prelude.Generic)
newEndpointIdentifier ::
Prelude.Text ->
EndpointIdentifier
newEndpointIdentifier :: Text -> EndpointIdentifier
newEndpointIdentifier Text
pEndpointId_ =
EndpointIdentifier'
{ $sel:clientIPPreservationEnabled:EndpointIdentifier' :: Maybe Bool
clientIPPreservationEnabled =
forall a. Maybe a
Prelude.Nothing,
$sel:endpointId:EndpointIdentifier' :: Text
endpointId = Text
pEndpointId_
}
endpointIdentifier_clientIPPreservationEnabled :: Lens.Lens' EndpointIdentifier (Prelude.Maybe Prelude.Bool)
endpointIdentifier_clientIPPreservationEnabled :: Lens' EndpointIdentifier (Maybe Bool)
endpointIdentifier_clientIPPreservationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointIdentifier' {Maybe Bool
clientIPPreservationEnabled :: Maybe Bool
$sel:clientIPPreservationEnabled:EndpointIdentifier' :: EndpointIdentifier -> Maybe Bool
clientIPPreservationEnabled} -> Maybe Bool
clientIPPreservationEnabled) (\s :: EndpointIdentifier
s@EndpointIdentifier' {} Maybe Bool
a -> EndpointIdentifier
s {$sel:clientIPPreservationEnabled:EndpointIdentifier' :: Maybe Bool
clientIPPreservationEnabled = Maybe Bool
a} :: EndpointIdentifier)
endpointIdentifier_endpointId :: Lens.Lens' EndpointIdentifier Prelude.Text
endpointIdentifier_endpointId :: Lens' EndpointIdentifier Text
endpointIdentifier_endpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointIdentifier' {Text
endpointId :: Text
$sel:endpointId:EndpointIdentifier' :: EndpointIdentifier -> Text
endpointId} -> Text
endpointId) (\s :: EndpointIdentifier
s@EndpointIdentifier' {} Text
a -> EndpointIdentifier
s {$sel:endpointId:EndpointIdentifier' :: Text
endpointId = Text
a} :: EndpointIdentifier)
instance Prelude.Hashable EndpointIdentifier where
hashWithSalt :: Int -> EndpointIdentifier -> Int
hashWithSalt Int
_salt EndpointIdentifier' {Maybe Bool
Text
endpointId :: Text
clientIPPreservationEnabled :: Maybe Bool
$sel:endpointId:EndpointIdentifier' :: EndpointIdentifier -> Text
$sel:clientIPPreservationEnabled:EndpointIdentifier' :: EndpointIdentifier -> 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` Text
endpointId
instance Prelude.NFData EndpointIdentifier where
rnf :: EndpointIdentifier -> ()
rnf EndpointIdentifier' {Maybe Bool
Text
endpointId :: Text
clientIPPreservationEnabled :: Maybe Bool
$sel:endpointId:EndpointIdentifier' :: EndpointIdentifier -> Text
$sel:clientIPPreservationEnabled:EndpointIdentifier' :: EndpointIdentifier -> 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 Text
endpointId
instance Data.ToJSON EndpointIdentifier where
toJSON :: EndpointIdentifier -> Value
toJSON EndpointIdentifier' {Maybe Bool
Text
endpointId :: Text
clientIPPreservationEnabled :: Maybe Bool
$sel:endpointId:EndpointIdentifier' :: EndpointIdentifier -> Text
$sel:clientIPPreservationEnabled:EndpointIdentifier' :: EndpointIdentifier -> 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,
forall a. a -> Maybe a
Prelude.Just (Key
"EndpointId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
endpointId)
]
)