{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GlobalAccelerator.Types.EndpointGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GlobalAccelerator.Types.EndpointGroup 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.EndpointDescription
import Amazonka.GlobalAccelerator.Types.HealthCheckProtocol
import Amazonka.GlobalAccelerator.Types.PortOverride
import qualified Amazonka.Prelude as Prelude

-- | A complex type for the endpoint group. An Amazon Web Services Region can
-- have only one endpoint group for a specific listener.
--
-- /See:/ 'newEndpointGroup' smart constructor.
data EndpointGroup = EndpointGroup'
  { -- | The list of endpoint objects.
    EndpointGroup -> Maybe [EndpointDescription]
endpointDescriptions :: Prelude.Maybe [EndpointDescription],
    -- | The Amazon Resource Name (ARN) of the endpoint group.
    EndpointGroup -> Maybe Text
endpointGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region where the endpoint group is located.
    EndpointGroup -> Maybe Text
endpointGroupRegion :: Prelude.Maybe Prelude.Text,
    -- | The time—10 seconds or 30 seconds—between health checks for each
    -- endpoint. The default value is 30.
    EndpointGroup -> Maybe Natural
healthCheckIntervalSeconds :: Prelude.Maybe Prelude.Natural,
    -- | If the protocol is HTTP\/S, then this value provides the ping path that
    -- Global Accelerator uses for the destination on the endpoints for health
    -- checks. The default is slash (\/).
    EndpointGroup -> Maybe Text
healthCheckPath :: Prelude.Maybe Prelude.Text,
    -- | The port that Global Accelerator uses to perform health checks on
    -- endpoints that are part of this endpoint group.
    --
    -- The default port is the port for the listener that this endpoint group
    -- is associated with. If the listener port is a list, Global Accelerator
    -- uses the first specified port in the list of ports.
    EndpointGroup -> Maybe Natural
healthCheckPort :: Prelude.Maybe Prelude.Natural,
    -- | The protocol that Global Accelerator uses to perform health checks on
    -- endpoints that are part of this endpoint group. The default value is
    -- TCP.
    EndpointGroup -> Maybe HealthCheckProtocol
healthCheckProtocol :: Prelude.Maybe HealthCheckProtocol,
    -- | Allows you to override the destination ports used to route traffic to an
    -- endpoint. Using a port override lets you map a list of external
    -- destination ports (that your users send traffic to) to a list of
    -- internal destination ports that you want an application endpoint to
    -- receive traffic on.
    EndpointGroup -> Maybe [PortOverride]
portOverrides :: Prelude.Maybe [PortOverride],
    -- | The number of consecutive health checks required to set the state of a
    -- healthy endpoint to unhealthy, or to set an unhealthy endpoint to
    -- healthy. The default value is 3.
    EndpointGroup -> Maybe Natural
thresholdCount :: Prelude.Maybe Prelude.Natural,
    -- | The percentage of traffic to send to an Amazon Web Services Region.
    -- Additional traffic is distributed to other endpoint groups for this
    -- listener.
    --
    -- Use this action to increase (dial up) or decrease (dial down) traffic to
    -- a specific Region. The percentage is applied to the traffic that would
    -- otherwise have been routed to the Region based on optimal routing.
    --
    -- The default value is 100.
    EndpointGroup -> Maybe Double
trafficDialPercentage :: Prelude.Maybe Prelude.Double
  }
  deriving (EndpointGroup -> EndpointGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointGroup -> EndpointGroup -> Bool
$c/= :: EndpointGroup -> EndpointGroup -> Bool
== :: EndpointGroup -> EndpointGroup -> Bool
$c== :: EndpointGroup -> EndpointGroup -> Bool
Prelude.Eq, ReadPrec [EndpointGroup]
ReadPrec EndpointGroup
Int -> ReadS EndpointGroup
ReadS [EndpointGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointGroup]
$creadListPrec :: ReadPrec [EndpointGroup]
readPrec :: ReadPrec EndpointGroup
$creadPrec :: ReadPrec EndpointGroup
readList :: ReadS [EndpointGroup]
$creadList :: ReadS [EndpointGroup]
readsPrec :: Int -> ReadS EndpointGroup
$creadsPrec :: Int -> ReadS EndpointGroup
Prelude.Read, Int -> EndpointGroup -> ShowS
[EndpointGroup] -> ShowS
EndpointGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointGroup] -> ShowS
$cshowList :: [EndpointGroup] -> ShowS
show :: EndpointGroup -> String
$cshow :: EndpointGroup -> String
showsPrec :: Int -> EndpointGroup -> ShowS
$cshowsPrec :: Int -> EndpointGroup -> ShowS
Prelude.Show, forall x. Rep EndpointGroup x -> EndpointGroup
forall x. EndpointGroup -> Rep EndpointGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointGroup x -> EndpointGroup
$cfrom :: forall x. EndpointGroup -> Rep EndpointGroup x
Prelude.Generic)

-- |
-- Create a value of 'EndpointGroup' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'endpointDescriptions', 'endpointGroup_endpointDescriptions' - The list of endpoint objects.
--
-- 'endpointGroupArn', 'endpointGroup_endpointGroupArn' - The Amazon Resource Name (ARN) of the endpoint group.
--
-- 'endpointGroupRegion', 'endpointGroup_endpointGroupRegion' - The Amazon Web Services Region where the endpoint group is located.
--
-- 'healthCheckIntervalSeconds', 'endpointGroup_healthCheckIntervalSeconds' - The time—10 seconds or 30 seconds—between health checks for each
-- endpoint. The default value is 30.
--
-- 'healthCheckPath', 'endpointGroup_healthCheckPath' - If the protocol is HTTP\/S, then this value provides the ping path that
-- Global Accelerator uses for the destination on the endpoints for health
-- checks. The default is slash (\/).
--
-- 'healthCheckPort', 'endpointGroup_healthCheckPort' - The port that Global Accelerator uses to perform health checks on
-- endpoints that are part of this endpoint group.
--
-- The default port is the port for the listener that this endpoint group
-- is associated with. If the listener port is a list, Global Accelerator
-- uses the first specified port in the list of ports.
--
-- 'healthCheckProtocol', 'endpointGroup_healthCheckProtocol' - The protocol that Global Accelerator uses to perform health checks on
-- endpoints that are part of this endpoint group. The default value is
-- TCP.
--
-- 'portOverrides', 'endpointGroup_portOverrides' - Allows you to override the destination ports used to route traffic to an
-- endpoint. Using a port override lets you map a list of external
-- destination ports (that your users send traffic to) to a list of
-- internal destination ports that you want an application endpoint to
-- receive traffic on.
--
-- 'thresholdCount', 'endpointGroup_thresholdCount' - The number of consecutive health checks required to set the state of a
-- healthy endpoint to unhealthy, or to set an unhealthy endpoint to
-- healthy. The default value is 3.
--
-- 'trafficDialPercentage', 'endpointGroup_trafficDialPercentage' - The percentage of traffic to send to an Amazon Web Services Region.
-- Additional traffic is distributed to other endpoint groups for this
-- listener.
--
-- Use this action to increase (dial up) or decrease (dial down) traffic to
-- a specific Region. The percentage is applied to the traffic that would
-- otherwise have been routed to the Region based on optimal routing.
--
-- The default value is 100.
newEndpointGroup ::
  EndpointGroup
newEndpointGroup :: EndpointGroup
newEndpointGroup =
  EndpointGroup'
    { $sel:endpointDescriptions:EndpointGroup' :: Maybe [EndpointDescription]
endpointDescriptions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:endpointGroupArn:EndpointGroup' :: Maybe Text
endpointGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointGroupRegion:EndpointGroup' :: Maybe Text
endpointGroupRegion = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckIntervalSeconds:EndpointGroup' :: Maybe Natural
healthCheckIntervalSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPath:EndpointGroup' :: Maybe Text
healthCheckPath = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPort:EndpointGroup' :: Maybe Natural
healthCheckPort = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckProtocol:EndpointGroup' :: Maybe HealthCheckProtocol
healthCheckProtocol = forall a. Maybe a
Prelude.Nothing,
      $sel:portOverrides:EndpointGroup' :: Maybe [PortOverride]
portOverrides = forall a. Maybe a
Prelude.Nothing,
      $sel:thresholdCount:EndpointGroup' :: Maybe Natural
thresholdCount = forall a. Maybe a
Prelude.Nothing,
      $sel:trafficDialPercentage:EndpointGroup' :: Maybe Double
trafficDialPercentage = forall a. Maybe a
Prelude.Nothing
    }

-- | The list of endpoint objects.
endpointGroup_endpointDescriptions :: Lens.Lens' EndpointGroup (Prelude.Maybe [EndpointDescription])
endpointGroup_endpointDescriptions :: Lens' EndpointGroup (Maybe [EndpointDescription])
endpointGroup_endpointDescriptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe [EndpointDescription]
endpointDescriptions :: Maybe [EndpointDescription]
$sel:endpointDescriptions:EndpointGroup' :: EndpointGroup -> Maybe [EndpointDescription]
endpointDescriptions} -> Maybe [EndpointDescription]
endpointDescriptions) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe [EndpointDescription]
a -> EndpointGroup
s {$sel:endpointDescriptions:EndpointGroup' :: Maybe [EndpointDescription]
endpointDescriptions = Maybe [EndpointDescription]
a} :: EndpointGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the endpoint group.
endpointGroup_endpointGroupArn :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Text)
endpointGroup_endpointGroupArn :: Lens' EndpointGroup (Maybe Text)
endpointGroup_endpointGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe Text
endpointGroupArn :: Maybe Text
$sel:endpointGroupArn:EndpointGroup' :: EndpointGroup -> Maybe Text
endpointGroupArn} -> Maybe Text
endpointGroupArn) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe Text
a -> EndpointGroup
s {$sel:endpointGroupArn:EndpointGroup' :: Maybe Text
endpointGroupArn = Maybe Text
a} :: EndpointGroup)

-- | The Amazon Web Services Region where the endpoint group is located.
endpointGroup_endpointGroupRegion :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Text)
endpointGroup_endpointGroupRegion :: Lens' EndpointGroup (Maybe Text)
endpointGroup_endpointGroupRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe Text
endpointGroupRegion :: Maybe Text
$sel:endpointGroupRegion:EndpointGroup' :: EndpointGroup -> Maybe Text
endpointGroupRegion} -> Maybe Text
endpointGroupRegion) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe Text
a -> EndpointGroup
s {$sel:endpointGroupRegion:EndpointGroup' :: Maybe Text
endpointGroupRegion = Maybe Text
a} :: EndpointGroup)

-- | The time—10 seconds or 30 seconds—between health checks for each
-- endpoint. The default value is 30.
endpointGroup_healthCheckIntervalSeconds :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Natural)
endpointGroup_healthCheckIntervalSeconds :: Lens' EndpointGroup (Maybe Natural)
endpointGroup_healthCheckIntervalSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe Natural
healthCheckIntervalSeconds :: Maybe Natural
$sel:healthCheckIntervalSeconds:EndpointGroup' :: EndpointGroup -> Maybe Natural
healthCheckIntervalSeconds} -> Maybe Natural
healthCheckIntervalSeconds) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe Natural
a -> EndpointGroup
s {$sel:healthCheckIntervalSeconds:EndpointGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
a} :: EndpointGroup)

-- | If the protocol is HTTP\/S, then this value provides the ping path that
-- Global Accelerator uses for the destination on the endpoints for health
-- checks. The default is slash (\/).
endpointGroup_healthCheckPath :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Text)
endpointGroup_healthCheckPath :: Lens' EndpointGroup (Maybe Text)
endpointGroup_healthCheckPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe Text
healthCheckPath :: Maybe Text
$sel:healthCheckPath:EndpointGroup' :: EndpointGroup -> Maybe Text
healthCheckPath} -> Maybe Text
healthCheckPath) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe Text
a -> EndpointGroup
s {$sel:healthCheckPath:EndpointGroup' :: Maybe Text
healthCheckPath = Maybe Text
a} :: EndpointGroup)

-- | The port that Global Accelerator uses to perform health checks on
-- endpoints that are part of this endpoint group.
--
-- The default port is the port for the listener that this endpoint group
-- is associated with. If the listener port is a list, Global Accelerator
-- uses the first specified port in the list of ports.
endpointGroup_healthCheckPort :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Natural)
endpointGroup_healthCheckPort :: Lens' EndpointGroup (Maybe Natural)
endpointGroup_healthCheckPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe Natural
healthCheckPort :: Maybe Natural
$sel:healthCheckPort:EndpointGroup' :: EndpointGroup -> Maybe Natural
healthCheckPort} -> Maybe Natural
healthCheckPort) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe Natural
a -> EndpointGroup
s {$sel:healthCheckPort:EndpointGroup' :: Maybe Natural
healthCheckPort = Maybe Natural
a} :: EndpointGroup)

-- | The protocol that Global Accelerator uses to perform health checks on
-- endpoints that are part of this endpoint group. The default value is
-- TCP.
endpointGroup_healthCheckProtocol :: Lens.Lens' EndpointGroup (Prelude.Maybe HealthCheckProtocol)
endpointGroup_healthCheckProtocol :: Lens' EndpointGroup (Maybe HealthCheckProtocol)
endpointGroup_healthCheckProtocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe HealthCheckProtocol
healthCheckProtocol :: Maybe HealthCheckProtocol
$sel:healthCheckProtocol:EndpointGroup' :: EndpointGroup -> Maybe HealthCheckProtocol
healthCheckProtocol} -> Maybe HealthCheckProtocol
healthCheckProtocol) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe HealthCheckProtocol
a -> EndpointGroup
s {$sel:healthCheckProtocol:EndpointGroup' :: Maybe HealthCheckProtocol
healthCheckProtocol = Maybe HealthCheckProtocol
a} :: EndpointGroup)

-- | Allows you to override the destination ports used to route traffic to an
-- endpoint. Using a port override lets you map a list of external
-- destination ports (that your users send traffic to) to a list of
-- internal destination ports that you want an application endpoint to
-- receive traffic on.
endpointGroup_portOverrides :: Lens.Lens' EndpointGroup (Prelude.Maybe [PortOverride])
endpointGroup_portOverrides :: Lens' EndpointGroup (Maybe [PortOverride])
endpointGroup_portOverrides = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe [PortOverride]
portOverrides :: Maybe [PortOverride]
$sel:portOverrides:EndpointGroup' :: EndpointGroup -> Maybe [PortOverride]
portOverrides} -> Maybe [PortOverride]
portOverrides) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe [PortOverride]
a -> EndpointGroup
s {$sel:portOverrides:EndpointGroup' :: Maybe [PortOverride]
portOverrides = Maybe [PortOverride]
a} :: EndpointGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of consecutive health checks required to set the state of a
-- healthy endpoint to unhealthy, or to set an unhealthy endpoint to
-- healthy. The default value is 3.
endpointGroup_thresholdCount :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Natural)
endpointGroup_thresholdCount :: Lens' EndpointGroup (Maybe Natural)
endpointGroup_thresholdCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe Natural
thresholdCount :: Maybe Natural
$sel:thresholdCount:EndpointGroup' :: EndpointGroup -> Maybe Natural
thresholdCount} -> Maybe Natural
thresholdCount) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe Natural
a -> EndpointGroup
s {$sel:thresholdCount:EndpointGroup' :: Maybe Natural
thresholdCount = Maybe Natural
a} :: EndpointGroup)

-- | The percentage of traffic to send to an Amazon Web Services Region.
-- Additional traffic is distributed to other endpoint groups for this
-- listener.
--
-- Use this action to increase (dial up) or decrease (dial down) traffic to
-- a specific Region. The percentage is applied to the traffic that would
-- otherwise have been routed to the Region based on optimal routing.
--
-- The default value is 100.
endpointGroup_trafficDialPercentage :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Double)
endpointGroup_trafficDialPercentage :: Lens' EndpointGroup (Maybe Double)
endpointGroup_trafficDialPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointGroup' {Maybe Double
trafficDialPercentage :: Maybe Double
$sel:trafficDialPercentage:EndpointGroup' :: EndpointGroup -> Maybe Double
trafficDialPercentage} -> Maybe Double
trafficDialPercentage) (\s :: EndpointGroup
s@EndpointGroup' {} Maybe Double
a -> EndpointGroup
s {$sel:trafficDialPercentage:EndpointGroup' :: Maybe Double
trafficDialPercentage = Maybe Double
a} :: EndpointGroup)

instance Data.FromJSON EndpointGroup where
  parseJSON :: Value -> Parser EndpointGroup
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EndpointGroup"
      ( \Object
x ->
          Maybe [EndpointDescription]
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe HealthCheckProtocol
-> Maybe [PortOverride]
-> Maybe Natural
-> Maybe Double
-> EndpointGroup
EndpointGroup'
            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
"EndpointDescriptions"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"EndpointGroupArn")
            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
"EndpointGroupRegion")
            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
"HealthCheckIntervalSeconds")
            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
"HealthCheckPath")
            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
"HealthCheckPort")
            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
"HealthCheckProtocol")
            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
"PortOverrides" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"ThresholdCount")
            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
"TrafficDialPercentage")
      )

instance Prelude.Hashable EndpointGroup where
  hashWithSalt :: Int -> EndpointGroup -> Int
hashWithSalt Int
_salt EndpointGroup' {Maybe Double
Maybe Natural
Maybe [EndpointDescription]
Maybe [PortOverride]
Maybe Text
Maybe HealthCheckProtocol
trafficDialPercentage :: Maybe Double
thresholdCount :: Maybe Natural
portOverrides :: Maybe [PortOverride]
healthCheckProtocol :: Maybe HealthCheckProtocol
healthCheckPort :: Maybe Natural
healthCheckPath :: Maybe Text
healthCheckIntervalSeconds :: Maybe Natural
endpointGroupRegion :: Maybe Text
endpointGroupArn :: Maybe Text
endpointDescriptions :: Maybe [EndpointDescription]
$sel:trafficDialPercentage:EndpointGroup' :: EndpointGroup -> Maybe Double
$sel:thresholdCount:EndpointGroup' :: EndpointGroup -> Maybe Natural
$sel:portOverrides:EndpointGroup' :: EndpointGroup -> Maybe [PortOverride]
$sel:healthCheckProtocol:EndpointGroup' :: EndpointGroup -> Maybe HealthCheckProtocol
$sel:healthCheckPort:EndpointGroup' :: EndpointGroup -> Maybe Natural
$sel:healthCheckPath:EndpointGroup' :: EndpointGroup -> Maybe Text
$sel:healthCheckIntervalSeconds:EndpointGroup' :: EndpointGroup -> Maybe Natural
$sel:endpointGroupRegion:EndpointGroup' :: EndpointGroup -> Maybe Text
$sel:endpointGroupArn:EndpointGroup' :: EndpointGroup -> Maybe Text
$sel:endpointDescriptions:EndpointGroup' :: EndpointGroup -> Maybe [EndpointDescription]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EndpointDescription]
endpointDescriptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointGroupRegion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
healthCheckIntervalSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
healthCheckPath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
healthCheckPort
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HealthCheckProtocol
healthCheckProtocol
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PortOverride]
portOverrides
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
thresholdCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
trafficDialPercentage

instance Prelude.NFData EndpointGroup where
  rnf :: EndpointGroup -> ()
rnf EndpointGroup' {Maybe Double
Maybe Natural
Maybe [EndpointDescription]
Maybe [PortOverride]
Maybe Text
Maybe HealthCheckProtocol
trafficDialPercentage :: Maybe Double
thresholdCount :: Maybe Natural
portOverrides :: Maybe [PortOverride]
healthCheckProtocol :: Maybe HealthCheckProtocol
healthCheckPort :: Maybe Natural
healthCheckPath :: Maybe Text
healthCheckIntervalSeconds :: Maybe Natural
endpointGroupRegion :: Maybe Text
endpointGroupArn :: Maybe Text
endpointDescriptions :: Maybe [EndpointDescription]
$sel:trafficDialPercentage:EndpointGroup' :: EndpointGroup -> Maybe Double
$sel:thresholdCount:EndpointGroup' :: EndpointGroup -> Maybe Natural
$sel:portOverrides:EndpointGroup' :: EndpointGroup -> Maybe [PortOverride]
$sel:healthCheckProtocol:EndpointGroup' :: EndpointGroup -> Maybe HealthCheckProtocol
$sel:healthCheckPort:EndpointGroup' :: EndpointGroup -> Maybe Natural
$sel:healthCheckPath:EndpointGroup' :: EndpointGroup -> Maybe Text
$sel:healthCheckIntervalSeconds:EndpointGroup' :: EndpointGroup -> Maybe Natural
$sel:endpointGroupRegion:EndpointGroup' :: EndpointGroup -> Maybe Text
$sel:endpointGroupArn:EndpointGroup' :: EndpointGroup -> Maybe Text
$sel:endpointDescriptions:EndpointGroup' :: EndpointGroup -> Maybe [EndpointDescription]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [EndpointDescription]
endpointDescriptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointGroupRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
healthCheckIntervalSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
healthCheckPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
healthCheckPort
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HealthCheckProtocol
healthCheckProtocol
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PortOverride]
portOverrides
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
thresholdCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
trafficDialPercentage