{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GlobalAccelerator.CreateEndpointGroup
(
CreateEndpointGroup (..),
newCreateEndpointGroup,
createEndpointGroup_thresholdCount,
createEndpointGroup_healthCheckPath,
createEndpointGroup_healthCheckIntervalSeconds,
createEndpointGroup_healthCheckProtocol,
createEndpointGroup_trafficDialPercentage,
createEndpointGroup_endpointConfigurations,
createEndpointGroup_healthCheckPort,
createEndpointGroup_portOverrides,
createEndpointGroup_listenerArn,
createEndpointGroup_endpointGroupRegion,
createEndpointGroup_idempotencyToken,
CreateEndpointGroupResponse (..),
newCreateEndpointGroupResponse,
createEndpointGroupResponse_endpointGroup,
createEndpointGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateEndpointGroup = CreateEndpointGroup'
{
CreateEndpointGroup -> Maybe Natural
thresholdCount :: Prelude.Maybe Prelude.Natural,
CreateEndpointGroup -> Maybe Text
healthCheckPath :: Prelude.Maybe Prelude.Text,
CreateEndpointGroup -> Maybe Natural
healthCheckIntervalSeconds :: Prelude.Maybe Prelude.Natural,
CreateEndpointGroup -> Maybe HealthCheckProtocol
healthCheckProtocol :: Prelude.Maybe HealthCheckProtocol,
CreateEndpointGroup -> Maybe Double
trafficDialPercentage :: Prelude.Maybe Prelude.Double,
CreateEndpointGroup -> Maybe [EndpointConfiguration]
endpointConfigurations :: Prelude.Maybe [EndpointConfiguration],
CreateEndpointGroup -> Maybe Natural
healthCheckPort :: Prelude.Maybe Prelude.Natural,
CreateEndpointGroup -> Maybe [PortOverride]
portOverrides :: Prelude.Maybe [PortOverride],
CreateEndpointGroup -> Text
listenerArn :: Prelude.Text,
CreateEndpointGroup -> Text
endpointGroupRegion :: Prelude.Text,
CreateEndpointGroup -> Text
idempotencyToken :: Prelude.Text
}
deriving (CreateEndpointGroup -> CreateEndpointGroup -> Bool
(CreateEndpointGroup -> CreateEndpointGroup -> Bool)
-> (CreateEndpointGroup -> CreateEndpointGroup -> Bool)
-> Eq CreateEndpointGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEndpointGroup -> CreateEndpointGroup -> Bool
$c/= :: CreateEndpointGroup -> CreateEndpointGroup -> Bool
== :: CreateEndpointGroup -> CreateEndpointGroup -> Bool
$c== :: CreateEndpointGroup -> CreateEndpointGroup -> Bool
Prelude.Eq, ReadPrec [CreateEndpointGroup]
ReadPrec CreateEndpointGroup
Int -> ReadS CreateEndpointGroup
ReadS [CreateEndpointGroup]
(Int -> ReadS CreateEndpointGroup)
-> ReadS [CreateEndpointGroup]
-> ReadPrec CreateEndpointGroup
-> ReadPrec [CreateEndpointGroup]
-> Read CreateEndpointGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEndpointGroup]
$creadListPrec :: ReadPrec [CreateEndpointGroup]
readPrec :: ReadPrec CreateEndpointGroup
$creadPrec :: ReadPrec CreateEndpointGroup
readList :: ReadS [CreateEndpointGroup]
$creadList :: ReadS [CreateEndpointGroup]
readsPrec :: Int -> ReadS CreateEndpointGroup
$creadsPrec :: Int -> ReadS CreateEndpointGroup
Prelude.Read, Int -> CreateEndpointGroup -> ShowS
[CreateEndpointGroup] -> ShowS
CreateEndpointGroup -> String
(Int -> CreateEndpointGroup -> ShowS)
-> (CreateEndpointGroup -> String)
-> ([CreateEndpointGroup] -> ShowS)
-> Show CreateEndpointGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEndpointGroup] -> ShowS
$cshowList :: [CreateEndpointGroup] -> ShowS
show :: CreateEndpointGroup -> String
$cshow :: CreateEndpointGroup -> String
showsPrec :: Int -> CreateEndpointGroup -> ShowS
$cshowsPrec :: Int -> CreateEndpointGroup -> ShowS
Prelude.Show, (forall x. CreateEndpointGroup -> Rep CreateEndpointGroup x)
-> (forall x. Rep CreateEndpointGroup x -> CreateEndpointGroup)
-> Generic CreateEndpointGroup
forall x. Rep CreateEndpointGroup x -> CreateEndpointGroup
forall x. CreateEndpointGroup -> Rep CreateEndpointGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEndpointGroup x -> CreateEndpointGroup
$cfrom :: forall x. CreateEndpointGroup -> Rep CreateEndpointGroup x
Prelude.Generic)
newCreateEndpointGroup ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateEndpointGroup
newCreateEndpointGroup :: Text -> Text -> Text -> CreateEndpointGroup
newCreateEndpointGroup
Text
pListenerArn_
Text
pEndpointGroupRegion_
Text
pIdempotencyToken_ =
CreateEndpointGroup' :: Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe HealthCheckProtocol
-> Maybe Double
-> Maybe [EndpointConfiguration]
-> Maybe Natural
-> Maybe [PortOverride]
-> Text
-> Text
-> Text
-> CreateEndpointGroup
CreateEndpointGroup'
{ $sel:thresholdCount:CreateEndpointGroup' :: Maybe Natural
thresholdCount =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:healthCheckPath:CreateEndpointGroup' :: Maybe Text
healthCheckPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:healthCheckIntervalSeconds:CreateEndpointGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:healthCheckProtocol:CreateEndpointGroup' :: Maybe HealthCheckProtocol
healthCheckProtocol = Maybe HealthCheckProtocol
forall a. Maybe a
Prelude.Nothing,
$sel:trafficDialPercentage:CreateEndpointGroup' :: Maybe Double
trafficDialPercentage = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:endpointConfigurations:CreateEndpointGroup' :: Maybe [EndpointConfiguration]
endpointConfigurations = Maybe [EndpointConfiguration]
forall a. Maybe a
Prelude.Nothing,
$sel:healthCheckPort:CreateEndpointGroup' :: Maybe Natural
healthCheckPort = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:portOverrides:CreateEndpointGroup' :: Maybe [PortOverride]
portOverrides = Maybe [PortOverride]
forall a. Maybe a
Prelude.Nothing,
$sel:listenerArn:CreateEndpointGroup' :: Text
listenerArn = Text
pListenerArn_,
$sel:endpointGroupRegion:CreateEndpointGroup' :: Text
endpointGroupRegion = Text
pEndpointGroupRegion_,
$sel:idempotencyToken:CreateEndpointGroup' :: Text
idempotencyToken = Text
pIdempotencyToken_
}
createEndpointGroup_thresholdCount :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe Prelude.Natural)
createEndpointGroup_thresholdCount :: (Maybe Natural -> f (Maybe Natural))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_thresholdCount = (CreateEndpointGroup -> Maybe Natural)
-> (CreateEndpointGroup -> Maybe Natural -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup
CreateEndpointGroup
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe Natural
thresholdCount :: Maybe Natural
$sel:thresholdCount:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Natural
thresholdCount} -> Maybe Natural
thresholdCount) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe Natural
a -> CreateEndpointGroup
s {$sel:thresholdCount:CreateEndpointGroup' :: Maybe Natural
thresholdCount = Maybe Natural
a} :: CreateEndpointGroup)
createEndpointGroup_healthCheckPath :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe Prelude.Text)
createEndpointGroup_healthCheckPath :: (Maybe Text -> f (Maybe Text))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_healthCheckPath = (CreateEndpointGroup -> Maybe Text)
-> (CreateEndpointGroup -> Maybe Text -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup CreateEndpointGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe Text
healthCheckPath :: Maybe Text
$sel:healthCheckPath:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Text
healthCheckPath} -> Maybe Text
healthCheckPath) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe Text
a -> CreateEndpointGroup
s {$sel:healthCheckPath:CreateEndpointGroup' :: Maybe Text
healthCheckPath = Maybe Text
a} :: CreateEndpointGroup)
createEndpointGroup_healthCheckIntervalSeconds :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe Prelude.Natural)
createEndpointGroup_healthCheckIntervalSeconds :: (Maybe Natural -> f (Maybe Natural))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_healthCheckIntervalSeconds = (CreateEndpointGroup -> Maybe Natural)
-> (CreateEndpointGroup -> Maybe Natural -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup
CreateEndpointGroup
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe Natural
healthCheckIntervalSeconds :: Maybe Natural
$sel:healthCheckIntervalSeconds:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Natural
healthCheckIntervalSeconds} -> Maybe Natural
healthCheckIntervalSeconds) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe Natural
a -> CreateEndpointGroup
s {$sel:healthCheckIntervalSeconds:CreateEndpointGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
a} :: CreateEndpointGroup)
createEndpointGroup_healthCheckProtocol :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe HealthCheckProtocol)
createEndpointGroup_healthCheckProtocol :: (Maybe HealthCheckProtocol -> f (Maybe HealthCheckProtocol))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_healthCheckProtocol = (CreateEndpointGroup -> Maybe HealthCheckProtocol)
-> (CreateEndpointGroup
-> Maybe HealthCheckProtocol -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup
CreateEndpointGroup
(Maybe HealthCheckProtocol)
(Maybe HealthCheckProtocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe HealthCheckProtocol
healthCheckProtocol :: Maybe HealthCheckProtocol
$sel:healthCheckProtocol:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe HealthCheckProtocol
healthCheckProtocol} -> Maybe HealthCheckProtocol
healthCheckProtocol) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe HealthCheckProtocol
a -> CreateEndpointGroup
s {$sel:healthCheckProtocol:CreateEndpointGroup' :: Maybe HealthCheckProtocol
healthCheckProtocol = Maybe HealthCheckProtocol
a} :: CreateEndpointGroup)
createEndpointGroup_trafficDialPercentage :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe Prelude.Double)
createEndpointGroup_trafficDialPercentage :: (Maybe Double -> f (Maybe Double))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_trafficDialPercentage = (CreateEndpointGroup -> Maybe Double)
-> (CreateEndpointGroup -> Maybe Double -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup
CreateEndpointGroup
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe Double
trafficDialPercentage :: Maybe Double
$sel:trafficDialPercentage:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Double
trafficDialPercentage} -> Maybe Double
trafficDialPercentage) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe Double
a -> CreateEndpointGroup
s {$sel:trafficDialPercentage:CreateEndpointGroup' :: Maybe Double
trafficDialPercentage = Maybe Double
a} :: CreateEndpointGroup)
createEndpointGroup_endpointConfigurations :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe [EndpointConfiguration])
createEndpointGroup_endpointConfigurations :: (Maybe [EndpointConfiguration]
-> f (Maybe [EndpointConfiguration]))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_endpointConfigurations = (CreateEndpointGroup -> Maybe [EndpointConfiguration])
-> (CreateEndpointGroup
-> Maybe [EndpointConfiguration] -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup
CreateEndpointGroup
(Maybe [EndpointConfiguration])
(Maybe [EndpointConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe [EndpointConfiguration]
endpointConfigurations :: Maybe [EndpointConfiguration]
$sel:endpointConfigurations:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe [EndpointConfiguration]
endpointConfigurations} -> Maybe [EndpointConfiguration]
endpointConfigurations) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe [EndpointConfiguration]
a -> CreateEndpointGroup
s {$sel:endpointConfigurations:CreateEndpointGroup' :: Maybe [EndpointConfiguration]
endpointConfigurations = Maybe [EndpointConfiguration]
a} :: CreateEndpointGroup) ((Maybe [EndpointConfiguration]
-> f (Maybe [EndpointConfiguration]))
-> CreateEndpointGroup -> f CreateEndpointGroup)
-> ((Maybe [EndpointConfiguration]
-> f (Maybe [EndpointConfiguration]))
-> Maybe [EndpointConfiguration]
-> f (Maybe [EndpointConfiguration]))
-> (Maybe [EndpointConfiguration]
-> f (Maybe [EndpointConfiguration]))
-> CreateEndpointGroup
-> f CreateEndpointGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EndpointConfiguration]
[EndpointConfiguration]
[EndpointConfiguration]
[EndpointConfiguration]
-> Iso
(Maybe [EndpointConfiguration])
(Maybe [EndpointConfiguration])
(Maybe [EndpointConfiguration])
(Maybe [EndpointConfiguration])
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 AnIso
[EndpointConfiguration]
[EndpointConfiguration]
[EndpointConfiguration]
[EndpointConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createEndpointGroup_healthCheckPort :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe Prelude.Natural)
createEndpointGroup_healthCheckPort :: (Maybe Natural -> f (Maybe Natural))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_healthCheckPort = (CreateEndpointGroup -> Maybe Natural)
-> (CreateEndpointGroup -> Maybe Natural -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup
CreateEndpointGroup
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe Natural
healthCheckPort :: Maybe Natural
$sel:healthCheckPort:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Natural
healthCheckPort} -> Maybe Natural
healthCheckPort) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe Natural
a -> CreateEndpointGroup
s {$sel:healthCheckPort:CreateEndpointGroup' :: Maybe Natural
healthCheckPort = Maybe Natural
a} :: CreateEndpointGroup)
createEndpointGroup_portOverrides :: Lens.Lens' CreateEndpointGroup (Prelude.Maybe [PortOverride])
createEndpointGroup_portOverrides :: (Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_portOverrides = (CreateEndpointGroup -> Maybe [PortOverride])
-> (CreateEndpointGroup
-> Maybe [PortOverride] -> CreateEndpointGroup)
-> Lens
CreateEndpointGroup
CreateEndpointGroup
(Maybe [PortOverride])
(Maybe [PortOverride])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Maybe [PortOverride]
portOverrides :: Maybe [PortOverride]
$sel:portOverrides:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe [PortOverride]
portOverrides} -> Maybe [PortOverride]
portOverrides) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Maybe [PortOverride]
a -> CreateEndpointGroup
s {$sel:portOverrides:CreateEndpointGroup' :: Maybe [PortOverride]
portOverrides = Maybe [PortOverride]
a} :: CreateEndpointGroup) ((Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> CreateEndpointGroup -> f CreateEndpointGroup)
-> ((Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> (Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> CreateEndpointGroup
-> f CreateEndpointGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [PortOverride] [PortOverride] [PortOverride] [PortOverride]
-> Iso
(Maybe [PortOverride])
(Maybe [PortOverride])
(Maybe [PortOverride])
(Maybe [PortOverride])
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 AnIso [PortOverride] [PortOverride] [PortOverride] [PortOverride]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createEndpointGroup_listenerArn :: Lens.Lens' CreateEndpointGroup Prelude.Text
createEndpointGroup_listenerArn :: (Text -> f Text) -> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_listenerArn = (CreateEndpointGroup -> Text)
-> (CreateEndpointGroup -> Text -> CreateEndpointGroup)
-> Lens CreateEndpointGroup CreateEndpointGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Text
listenerArn :: Text
$sel:listenerArn:CreateEndpointGroup' :: CreateEndpointGroup -> Text
listenerArn} -> Text
listenerArn) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Text
a -> CreateEndpointGroup
s {$sel:listenerArn:CreateEndpointGroup' :: Text
listenerArn = Text
a} :: CreateEndpointGroup)
createEndpointGroup_endpointGroupRegion :: Lens.Lens' CreateEndpointGroup Prelude.Text
createEndpointGroup_endpointGroupRegion :: (Text -> f Text) -> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_endpointGroupRegion = (CreateEndpointGroup -> Text)
-> (CreateEndpointGroup -> Text -> CreateEndpointGroup)
-> Lens CreateEndpointGroup CreateEndpointGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Text
endpointGroupRegion :: Text
$sel:endpointGroupRegion:CreateEndpointGroup' :: CreateEndpointGroup -> Text
endpointGroupRegion} -> Text
endpointGroupRegion) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Text
a -> CreateEndpointGroup
s {$sel:endpointGroupRegion:CreateEndpointGroup' :: Text
endpointGroupRegion = Text
a} :: CreateEndpointGroup)
createEndpointGroup_idempotencyToken :: Lens.Lens' CreateEndpointGroup Prelude.Text
createEndpointGroup_idempotencyToken :: (Text -> f Text) -> CreateEndpointGroup -> f CreateEndpointGroup
createEndpointGroup_idempotencyToken = (CreateEndpointGroup -> Text)
-> (CreateEndpointGroup -> Text -> CreateEndpointGroup)
-> Lens CreateEndpointGroup CreateEndpointGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroup' {Text
idempotencyToken :: Text
$sel:idempotencyToken:CreateEndpointGroup' :: CreateEndpointGroup -> Text
idempotencyToken} -> Text
idempotencyToken) (\s :: CreateEndpointGroup
s@CreateEndpointGroup' {} Text
a -> CreateEndpointGroup
s {$sel:idempotencyToken:CreateEndpointGroup' :: Text
idempotencyToken = Text
a} :: CreateEndpointGroup)
instance Core.AWSRequest CreateEndpointGroup where
type
AWSResponse CreateEndpointGroup =
CreateEndpointGroupResponse
request :: CreateEndpointGroup -> Request CreateEndpointGroup
request = Service -> CreateEndpointGroup -> Request CreateEndpointGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateEndpointGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateEndpointGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateEndpointGroup))
-> Logger
-> Service
-> Proxy CreateEndpointGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateEndpointGroup)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe EndpointGroup -> Int -> CreateEndpointGroupResponse
CreateEndpointGroupResponse'
(Maybe EndpointGroup -> Int -> CreateEndpointGroupResponse)
-> Either String (Maybe EndpointGroup)
-> Either String (Int -> CreateEndpointGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe EndpointGroup)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EndpointGroup")
Either String (Int -> CreateEndpointGroupResponse)
-> Either String Int -> Either String CreateEndpointGroupResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateEndpointGroup
instance Prelude.NFData CreateEndpointGroup
instance Core.ToHeaders CreateEndpointGroup where
toHeaders :: CreateEndpointGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateEndpointGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GlobalAccelerator_V20180706.CreateEndpointGroup" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateEndpointGroup where
toJSON :: CreateEndpointGroup -> Value
toJSON CreateEndpointGroup' {Maybe Double
Maybe Natural
Maybe [EndpointConfiguration]
Maybe [PortOverride]
Maybe Text
Maybe HealthCheckProtocol
Text
idempotencyToken :: Text
endpointGroupRegion :: Text
listenerArn :: Text
portOverrides :: Maybe [PortOverride]
healthCheckPort :: Maybe Natural
endpointConfigurations :: Maybe [EndpointConfiguration]
trafficDialPercentage :: Maybe Double
healthCheckProtocol :: Maybe HealthCheckProtocol
healthCheckIntervalSeconds :: Maybe Natural
healthCheckPath :: Maybe Text
thresholdCount :: Maybe Natural
$sel:idempotencyToken:CreateEndpointGroup' :: CreateEndpointGroup -> Text
$sel:endpointGroupRegion:CreateEndpointGroup' :: CreateEndpointGroup -> Text
$sel:listenerArn:CreateEndpointGroup' :: CreateEndpointGroup -> Text
$sel:portOverrides:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe [PortOverride]
$sel:healthCheckPort:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Natural
$sel:endpointConfigurations:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe [EndpointConfiguration]
$sel:trafficDialPercentage:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Double
$sel:healthCheckProtocol:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe HealthCheckProtocol
$sel:healthCheckIntervalSeconds:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Natural
$sel:healthCheckPath:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Text
$sel:thresholdCount:CreateEndpointGroup' :: CreateEndpointGroup -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ThresholdCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
thresholdCount,
(Text
"HealthCheckPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
healthCheckPath,
(Text
"HealthCheckIntervalSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
healthCheckIntervalSeconds,
(Text
"HealthCheckProtocol" Text -> HealthCheckProtocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HealthCheckProtocol -> Pair)
-> Maybe HealthCheckProtocol -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HealthCheckProtocol
healthCheckProtocol,
(Text
"TrafficDialPercentage" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
trafficDialPercentage,
(Text
"EndpointConfigurations" Text -> [EndpointConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([EndpointConfiguration] -> Pair)
-> Maybe [EndpointConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EndpointConfiguration]
endpointConfigurations,
(Text
"HealthCheckPort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
healthCheckPort,
(Text
"PortOverrides" Text -> [PortOverride] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([PortOverride] -> Pair) -> Maybe [PortOverride] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PortOverride]
portOverrides,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ListenerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
listenerArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"EndpointGroupRegion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointGroupRegion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"IdempotencyToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
idempotencyToken)
]
)
instance Core.ToPath CreateEndpointGroup where
toPath :: CreateEndpointGroup -> ByteString
toPath = ByteString -> CreateEndpointGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateEndpointGroup where
toQuery :: CreateEndpointGroup -> QueryString
toQuery = QueryString -> CreateEndpointGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateEndpointGroupResponse = CreateEndpointGroupResponse'
{
CreateEndpointGroupResponse -> Maybe EndpointGroup
endpointGroup :: Prelude.Maybe EndpointGroup,
CreateEndpointGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateEndpointGroupResponse -> CreateEndpointGroupResponse -> Bool
(CreateEndpointGroupResponse
-> CreateEndpointGroupResponse -> Bool)
-> (CreateEndpointGroupResponse
-> CreateEndpointGroupResponse -> Bool)
-> Eq CreateEndpointGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEndpointGroupResponse -> CreateEndpointGroupResponse -> Bool
$c/= :: CreateEndpointGroupResponse -> CreateEndpointGroupResponse -> Bool
== :: CreateEndpointGroupResponse -> CreateEndpointGroupResponse -> Bool
$c== :: CreateEndpointGroupResponse -> CreateEndpointGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateEndpointGroupResponse]
ReadPrec CreateEndpointGroupResponse
Int -> ReadS CreateEndpointGroupResponse
ReadS [CreateEndpointGroupResponse]
(Int -> ReadS CreateEndpointGroupResponse)
-> ReadS [CreateEndpointGroupResponse]
-> ReadPrec CreateEndpointGroupResponse
-> ReadPrec [CreateEndpointGroupResponse]
-> Read CreateEndpointGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEndpointGroupResponse]
$creadListPrec :: ReadPrec [CreateEndpointGroupResponse]
readPrec :: ReadPrec CreateEndpointGroupResponse
$creadPrec :: ReadPrec CreateEndpointGroupResponse
readList :: ReadS [CreateEndpointGroupResponse]
$creadList :: ReadS [CreateEndpointGroupResponse]
readsPrec :: Int -> ReadS CreateEndpointGroupResponse
$creadsPrec :: Int -> ReadS CreateEndpointGroupResponse
Prelude.Read, Int -> CreateEndpointGroupResponse -> ShowS
[CreateEndpointGroupResponse] -> ShowS
CreateEndpointGroupResponse -> String
(Int -> CreateEndpointGroupResponse -> ShowS)
-> (CreateEndpointGroupResponse -> String)
-> ([CreateEndpointGroupResponse] -> ShowS)
-> Show CreateEndpointGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEndpointGroupResponse] -> ShowS
$cshowList :: [CreateEndpointGroupResponse] -> ShowS
show :: CreateEndpointGroupResponse -> String
$cshow :: CreateEndpointGroupResponse -> String
showsPrec :: Int -> CreateEndpointGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateEndpointGroupResponse -> ShowS
Prelude.Show, (forall x.
CreateEndpointGroupResponse -> Rep CreateEndpointGroupResponse x)
-> (forall x.
Rep CreateEndpointGroupResponse x -> CreateEndpointGroupResponse)
-> Generic CreateEndpointGroupResponse
forall x.
Rep CreateEndpointGroupResponse x -> CreateEndpointGroupResponse
forall x.
CreateEndpointGroupResponse -> Rep CreateEndpointGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEndpointGroupResponse x -> CreateEndpointGroupResponse
$cfrom :: forall x.
CreateEndpointGroupResponse -> Rep CreateEndpointGroupResponse x
Prelude.Generic)
newCreateEndpointGroupResponse ::
Prelude.Int ->
CreateEndpointGroupResponse
newCreateEndpointGroupResponse :: Int -> CreateEndpointGroupResponse
newCreateEndpointGroupResponse Int
pHttpStatus_ =
CreateEndpointGroupResponse' :: Maybe EndpointGroup -> Int -> CreateEndpointGroupResponse
CreateEndpointGroupResponse'
{ $sel:endpointGroup:CreateEndpointGroupResponse' :: Maybe EndpointGroup
endpointGroup =
Maybe EndpointGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateEndpointGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createEndpointGroupResponse_endpointGroup :: Lens.Lens' CreateEndpointGroupResponse (Prelude.Maybe EndpointGroup)
createEndpointGroupResponse_endpointGroup :: (Maybe EndpointGroup -> f (Maybe EndpointGroup))
-> CreateEndpointGroupResponse -> f CreateEndpointGroupResponse
createEndpointGroupResponse_endpointGroup = (CreateEndpointGroupResponse -> Maybe EndpointGroup)
-> (CreateEndpointGroupResponse
-> Maybe EndpointGroup -> CreateEndpointGroupResponse)
-> Lens
CreateEndpointGroupResponse
CreateEndpointGroupResponse
(Maybe EndpointGroup)
(Maybe EndpointGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroupResponse' {Maybe EndpointGroup
endpointGroup :: Maybe EndpointGroup
$sel:endpointGroup:CreateEndpointGroupResponse' :: CreateEndpointGroupResponse -> Maybe EndpointGroup
endpointGroup} -> Maybe EndpointGroup
endpointGroup) (\s :: CreateEndpointGroupResponse
s@CreateEndpointGroupResponse' {} Maybe EndpointGroup
a -> CreateEndpointGroupResponse
s {$sel:endpointGroup:CreateEndpointGroupResponse' :: Maybe EndpointGroup
endpointGroup = Maybe EndpointGroup
a} :: CreateEndpointGroupResponse)
createEndpointGroupResponse_httpStatus :: Lens.Lens' CreateEndpointGroupResponse Prelude.Int
createEndpointGroupResponse_httpStatus :: (Int -> f Int)
-> CreateEndpointGroupResponse -> f CreateEndpointGroupResponse
createEndpointGroupResponse_httpStatus = (CreateEndpointGroupResponse -> Int)
-> (CreateEndpointGroupResponse
-> Int -> CreateEndpointGroupResponse)
-> Lens
CreateEndpointGroupResponse CreateEndpointGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateEndpointGroupResponse' :: CreateEndpointGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateEndpointGroupResponse
s@CreateEndpointGroupResponse' {} Int
a -> CreateEndpointGroupResponse
s {$sel:httpStatus:CreateEndpointGroupResponse' :: Int
httpStatus = Int
a} :: CreateEndpointGroupResponse)
instance Prelude.NFData CreateEndpointGroupResponse