{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GlobalAccelerator.Types.EndpointGroup where

import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types.EndpointDescription
import Amazonka.GlobalAccelerator.Types.HealthCheckProtocol
import Amazonka.GlobalAccelerator.Types.PortOverride
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A complex type for the endpoint group. An AWS Region can have only one
-- endpoint group for a specific listener.
--
-- /See:/ 'newEndpointGroup' smart constructor.
data EndpointGroup = EndpointGroup'
  { -- | 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,
    -- | 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 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,
    -- | The Amazon Resource Name (ARN) of the endpoint group.
    EndpointGroup -> Maybe Text
endpointGroupArn :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | The AWS Region where the endpoint group is located.
    EndpointGroup -> Maybe Text
endpointGroupRegion :: Prelude.Maybe Prelude.Text,
    -- | The percentage of traffic to send to an AWS 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,
    -- | 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,
    -- | Allows you to override the destination ports used to route traffic to an
    -- endpoint. Using a port override lets you to 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 list of endpoint objects.
    EndpointGroup -> Maybe [EndpointDescription]
endpointDescriptions :: Prelude.Maybe [EndpointDescription]
  }
  deriving (EndpointGroup -> EndpointGroup -> Bool
(EndpointGroup -> EndpointGroup -> Bool)
-> (EndpointGroup -> EndpointGroup -> Bool) -> Eq EndpointGroup
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]
(Int -> ReadS EndpointGroup)
-> ReadS [EndpointGroup]
-> ReadPrec EndpointGroup
-> ReadPrec [EndpointGroup]
-> Read 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
(Int -> EndpointGroup -> ShowS)
-> (EndpointGroup -> String)
-> ([EndpointGroup] -> ShowS)
-> Show EndpointGroup
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. EndpointGroup -> Rep EndpointGroup x)
-> (forall x. Rep EndpointGroup x -> EndpointGroup)
-> Generic EndpointGroup
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:
--
-- '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.
--
-- '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 (\/).
--
-- 'healthCheckIntervalSeconds', 'endpointGroup_healthCheckIntervalSeconds' - The time—10 seconds or 30 seconds—between health checks for each
-- endpoint. The default value is 30.
--
-- 'endpointGroupArn', 'endpointGroup_endpointGroupArn' - The Amazon Resource Name (ARN) of the endpoint group.
--
-- '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.
--
-- 'endpointGroupRegion', 'endpointGroup_endpointGroupRegion' - The AWS Region where the endpoint group is located.
--
-- 'trafficDialPercentage', 'endpointGroup_trafficDialPercentage' - The percentage of traffic to send to an AWS 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.
--
-- '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.
--
-- 'portOverrides', 'endpointGroup_portOverrides' - Allows you to override the destination ports used to route traffic to an
-- endpoint. Using a port override lets you to 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.
--
-- 'endpointDescriptions', 'endpointGroup_endpointDescriptions' - The list of endpoint objects.
newEndpointGroup ::
  EndpointGroup
newEndpointGroup :: EndpointGroup
newEndpointGroup =
  EndpointGroup' :: Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe HealthCheckProtocol
-> Maybe Text
-> Maybe Double
-> Maybe Natural
-> Maybe [PortOverride]
-> Maybe [EndpointDescription]
-> EndpointGroup
EndpointGroup'
    { $sel:thresholdCount:EndpointGroup' :: Maybe Natural
thresholdCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPath:EndpointGroup' :: Maybe Text
healthCheckPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckIntervalSeconds:EndpointGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointGroupArn:EndpointGroup' :: Maybe Text
endpointGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckProtocol:EndpointGroup' :: Maybe HealthCheckProtocol
healthCheckProtocol = Maybe HealthCheckProtocol
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointGroupRegion:EndpointGroup' :: Maybe Text
endpointGroupRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trafficDialPercentage:EndpointGroup' :: Maybe Double
trafficDialPercentage = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPort:EndpointGroup' :: Maybe Natural
healthCheckPort = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:portOverrides:EndpointGroup' :: Maybe [PortOverride]
portOverrides = Maybe [PortOverride]
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointDescriptions:EndpointGroup' :: Maybe [EndpointDescription]
endpointDescriptions = Maybe [EndpointDescription]
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> EndpointGroup -> f EndpointGroup
endpointGroup_thresholdCount = (EndpointGroup -> Maybe Natural)
-> (EndpointGroup -> Maybe Natural -> EndpointGroup)
-> Lens EndpointGroup EndpointGroup (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> EndpointGroup -> f EndpointGroup
endpointGroup_healthCheckPath = (EndpointGroup -> Maybe Text)
-> (EndpointGroup -> Maybe Text -> EndpointGroup)
-> Lens EndpointGroup EndpointGroup (Maybe Text) (Maybe Text)
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 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 :: (Maybe Natural -> f (Maybe Natural))
-> EndpointGroup -> f EndpointGroup
endpointGroup_healthCheckIntervalSeconds = (EndpointGroup -> Maybe Natural)
-> (EndpointGroup -> Maybe Natural -> EndpointGroup)
-> Lens EndpointGroup EndpointGroup (Maybe Natural) (Maybe Natural)
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)

-- | The Amazon Resource Name (ARN) of the endpoint group.
endpointGroup_endpointGroupArn :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Text)
endpointGroup_endpointGroupArn :: (Maybe Text -> f (Maybe Text)) -> EndpointGroup -> f EndpointGroup
endpointGroup_endpointGroupArn = (EndpointGroup -> Maybe Text)
-> (EndpointGroup -> Maybe Text -> EndpointGroup)
-> Lens EndpointGroup EndpointGroup (Maybe Text) (Maybe Text)
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 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 :: (Maybe HealthCheckProtocol -> f (Maybe HealthCheckProtocol))
-> EndpointGroup -> f EndpointGroup
endpointGroup_healthCheckProtocol = (EndpointGroup -> Maybe HealthCheckProtocol)
-> (EndpointGroup -> Maybe HealthCheckProtocol -> EndpointGroup)
-> Lens
     EndpointGroup
     EndpointGroup
     (Maybe HealthCheckProtocol)
     (Maybe 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)

-- | The AWS Region where the endpoint group is located.
endpointGroup_endpointGroupRegion :: Lens.Lens' EndpointGroup (Prelude.Maybe Prelude.Text)
endpointGroup_endpointGroupRegion :: (Maybe Text -> f (Maybe Text)) -> EndpointGroup -> f EndpointGroup
endpointGroup_endpointGroupRegion = (EndpointGroup -> Maybe Text)
-> (EndpointGroup -> Maybe Text -> EndpointGroup)
-> Lens EndpointGroup EndpointGroup (Maybe Text) (Maybe Text)
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 percentage of traffic to send to an AWS 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 :: (Maybe Double -> f (Maybe Double))
-> EndpointGroup -> f EndpointGroup
endpointGroup_trafficDialPercentage = (EndpointGroup -> Maybe Double)
-> (EndpointGroup -> Maybe Double -> EndpointGroup)
-> Lens EndpointGroup EndpointGroup (Maybe Double) (Maybe Double)
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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> EndpointGroup -> f EndpointGroup
endpointGroup_healthCheckPort = (EndpointGroup -> Maybe Natural)
-> (EndpointGroup -> Maybe Natural -> EndpointGroup)
-> Lens EndpointGroup EndpointGroup (Maybe Natural) (Maybe Natural)
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)

-- | Allows you to override the destination ports used to route traffic to an
-- endpoint. Using a port override lets you to 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 :: (Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> EndpointGroup -> f EndpointGroup
endpointGroup_portOverrides = (EndpointGroup -> Maybe [PortOverride])
-> (EndpointGroup -> Maybe [PortOverride] -> EndpointGroup)
-> Lens
     EndpointGroup
     EndpointGroup
     (Maybe [PortOverride])
     (Maybe [PortOverride])
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) ((Maybe [PortOverride] -> f (Maybe [PortOverride]))
 -> EndpointGroup -> f EndpointGroup)
-> ((Maybe [PortOverride] -> f (Maybe [PortOverride]))
    -> Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> (Maybe [PortOverride] -> f (Maybe [PortOverride]))
-> EndpointGroup
-> f EndpointGroup
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

-- | The list of endpoint objects.
endpointGroup_endpointDescriptions :: Lens.Lens' EndpointGroup (Prelude.Maybe [EndpointDescription])
endpointGroup_endpointDescriptions :: (Maybe [EndpointDescription] -> f (Maybe [EndpointDescription]))
-> EndpointGroup -> f EndpointGroup
endpointGroup_endpointDescriptions = (EndpointGroup -> Maybe [EndpointDescription])
-> (EndpointGroup -> Maybe [EndpointDescription] -> EndpointGroup)
-> Lens
     EndpointGroup
     EndpointGroup
     (Maybe [EndpointDescription])
     (Maybe [EndpointDescription])
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) ((Maybe [EndpointDescription] -> f (Maybe [EndpointDescription]))
 -> EndpointGroup -> f EndpointGroup)
-> ((Maybe [EndpointDescription]
     -> f (Maybe [EndpointDescription]))
    -> Maybe [EndpointDescription] -> f (Maybe [EndpointDescription]))
-> (Maybe [EndpointDescription] -> f (Maybe [EndpointDescription]))
-> EndpointGroup
-> f EndpointGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EndpointDescription]
  [EndpointDescription]
  [EndpointDescription]
  [EndpointDescription]
-> Iso
     (Maybe [EndpointDescription])
     (Maybe [EndpointDescription])
     (Maybe [EndpointDescription])
     (Maybe [EndpointDescription])
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
  [EndpointDescription]
  [EndpointDescription]
  [EndpointDescription]
  [EndpointDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable EndpointGroup

instance Prelude.NFData EndpointGroup