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

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

-- |
-- Module      : Amazonka.ELBV2.ModifyTargetGroup
-- 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)
--
-- Modifies the health checks used when evaluating the health state of the
-- targets in the specified target group.
module Amazonka.ELBV2.ModifyTargetGroup
  ( -- * Creating a Request
    ModifyTargetGroup (..),
    newModifyTargetGroup,

    -- * Request Lenses
    modifyTargetGroup_matcher,
    modifyTargetGroup_healthCheckPath,
    modifyTargetGroup_healthCheckEnabled,
    modifyTargetGroup_unhealthyThresholdCount,
    modifyTargetGroup_healthCheckIntervalSeconds,
    modifyTargetGroup_healthyThresholdCount,
    modifyTargetGroup_healthCheckProtocol,
    modifyTargetGroup_healthCheckTimeoutSeconds,
    modifyTargetGroup_healthCheckPort,
    modifyTargetGroup_targetGroupArn,

    -- * Destructuring the Response
    ModifyTargetGroupResponse (..),
    newModifyTargetGroupResponse,

    -- * Response Lenses
    modifyTargetGroupResponse_targetGroups,
    modifyTargetGroupResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ELBV2.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

-- | /See:/ 'newModifyTargetGroup' smart constructor.
data ModifyTargetGroup = ModifyTargetGroup'
  { -- | [HTTP\/HTTPS health checks] The HTTP or gRPC codes to use when checking
    -- for a successful response from a target.
    --
    -- With Network Load Balancers, you can\'t modify this setting.
    ModifyTargetGroup -> Maybe Matcher
matcher :: Prelude.Maybe Matcher,
    -- | [HTTP\/HTTPS health checks] The destination for health checks on the
    -- targets.
    --
    -- [HTTP1 or HTTP2 protocol version] The ping path. The default is \/.
    --
    -- [GRPC protocol version] The path of a custom health check method with
    -- the format \/package.service\/method. The default is \/Amazon Web
    -- Services.ALB\/healthcheck.
    ModifyTargetGroup -> Maybe Text
healthCheckPath :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether health checks are enabled.
    ModifyTargetGroup -> Maybe Bool
healthCheckEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The number of consecutive health check failures required before
    -- considering the target unhealthy. For target groups with a protocol of
    -- TCP or TLS, this value must be the same as the healthy threshold count.
    ModifyTargetGroup -> Maybe Natural
unhealthyThresholdCount :: Prelude.Maybe Prelude.Natural,
    -- | The approximate amount of time, in seconds, between health checks of an
    -- individual target. For TCP health checks, the supported values are 10 or
    -- 30 seconds.
    --
    -- With Network Load Balancers, you can\'t modify this setting.
    ModifyTargetGroup -> Maybe Natural
healthCheckIntervalSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The number of consecutive health checks successes required before
    -- considering an unhealthy target healthy.
    ModifyTargetGroup -> Maybe Natural
healthyThresholdCount :: Prelude.Maybe Prelude.Natural,
    -- | The protocol the load balancer uses when performing health checks on
    -- targets. For Application Load Balancers, the default is HTTP. For
    -- Network Load Balancers and Gateway Load Balancers, the default is TCP.
    -- The TCP protocol is not supported for health checks if the protocol of
    -- the target group is HTTP or HTTPS. It is supported for health checks
    -- only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP.
    -- The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health
    -- checks.
    --
    -- With Network Load Balancers, you can\'t modify this setting.
    ModifyTargetGroup -> Maybe ProtocolEnum
healthCheckProtocol :: Prelude.Maybe ProtocolEnum,
    -- | [HTTP\/HTTPS health checks] The amount of time, in seconds, during which
    -- no response means a failed health check.
    --
    -- With Network Load Balancers, you can\'t modify this setting.
    ModifyTargetGroup -> Maybe Natural
healthCheckTimeoutSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The port the load balancer uses when performing health checks on
    -- targets.
    ModifyTargetGroup -> Maybe Text
healthCheckPort :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the target group.
    ModifyTargetGroup -> Text
targetGroupArn :: Prelude.Text
  }
  deriving (ModifyTargetGroup -> ModifyTargetGroup -> Bool
(ModifyTargetGroup -> ModifyTargetGroup -> Bool)
-> (ModifyTargetGroup -> ModifyTargetGroup -> Bool)
-> Eq ModifyTargetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyTargetGroup -> ModifyTargetGroup -> Bool
$c/= :: ModifyTargetGroup -> ModifyTargetGroup -> Bool
== :: ModifyTargetGroup -> ModifyTargetGroup -> Bool
$c== :: ModifyTargetGroup -> ModifyTargetGroup -> Bool
Prelude.Eq, ReadPrec [ModifyTargetGroup]
ReadPrec ModifyTargetGroup
Int -> ReadS ModifyTargetGroup
ReadS [ModifyTargetGroup]
(Int -> ReadS ModifyTargetGroup)
-> ReadS [ModifyTargetGroup]
-> ReadPrec ModifyTargetGroup
-> ReadPrec [ModifyTargetGroup]
-> Read ModifyTargetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyTargetGroup]
$creadListPrec :: ReadPrec [ModifyTargetGroup]
readPrec :: ReadPrec ModifyTargetGroup
$creadPrec :: ReadPrec ModifyTargetGroup
readList :: ReadS [ModifyTargetGroup]
$creadList :: ReadS [ModifyTargetGroup]
readsPrec :: Int -> ReadS ModifyTargetGroup
$creadsPrec :: Int -> ReadS ModifyTargetGroup
Prelude.Read, Int -> ModifyTargetGroup -> ShowS
[ModifyTargetGroup] -> ShowS
ModifyTargetGroup -> String
(Int -> ModifyTargetGroup -> ShowS)
-> (ModifyTargetGroup -> String)
-> ([ModifyTargetGroup] -> ShowS)
-> Show ModifyTargetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyTargetGroup] -> ShowS
$cshowList :: [ModifyTargetGroup] -> ShowS
show :: ModifyTargetGroup -> String
$cshow :: ModifyTargetGroup -> String
showsPrec :: Int -> ModifyTargetGroup -> ShowS
$cshowsPrec :: Int -> ModifyTargetGroup -> ShowS
Prelude.Show, (forall x. ModifyTargetGroup -> Rep ModifyTargetGroup x)
-> (forall x. Rep ModifyTargetGroup x -> ModifyTargetGroup)
-> Generic ModifyTargetGroup
forall x. Rep ModifyTargetGroup x -> ModifyTargetGroup
forall x. ModifyTargetGroup -> Rep ModifyTargetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyTargetGroup x -> ModifyTargetGroup
$cfrom :: forall x. ModifyTargetGroup -> Rep ModifyTargetGroup x
Prelude.Generic)

-- |
-- Create a value of 'ModifyTargetGroup' 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:
--
-- 'matcher', 'modifyTargetGroup_matcher' - [HTTP\/HTTPS health checks] The HTTP or gRPC codes to use when checking
-- for a successful response from a target.
--
-- With Network Load Balancers, you can\'t modify this setting.
--
-- 'healthCheckPath', 'modifyTargetGroup_healthCheckPath' - [HTTP\/HTTPS health checks] The destination for health checks on the
-- targets.
--
-- [HTTP1 or HTTP2 protocol version] The ping path. The default is \/.
--
-- [GRPC protocol version] The path of a custom health check method with
-- the format \/package.service\/method. The default is \/Amazon Web
-- Services.ALB\/healthcheck.
--
-- 'healthCheckEnabled', 'modifyTargetGroup_healthCheckEnabled' - Indicates whether health checks are enabled.
--
-- 'unhealthyThresholdCount', 'modifyTargetGroup_unhealthyThresholdCount' - The number of consecutive health check failures required before
-- considering the target unhealthy. For target groups with a protocol of
-- TCP or TLS, this value must be the same as the healthy threshold count.
--
-- 'healthCheckIntervalSeconds', 'modifyTargetGroup_healthCheckIntervalSeconds' - The approximate amount of time, in seconds, between health checks of an
-- individual target. For TCP health checks, the supported values are 10 or
-- 30 seconds.
--
-- With Network Load Balancers, you can\'t modify this setting.
--
-- 'healthyThresholdCount', 'modifyTargetGroup_healthyThresholdCount' - The number of consecutive health checks successes required before
-- considering an unhealthy target healthy.
--
-- 'healthCheckProtocol', 'modifyTargetGroup_healthCheckProtocol' - The protocol the load balancer uses when performing health checks on
-- targets. For Application Load Balancers, the default is HTTP. For
-- Network Load Balancers and Gateway Load Balancers, the default is TCP.
-- The TCP protocol is not supported for health checks if the protocol of
-- the target group is HTTP or HTTPS. It is supported for health checks
-- only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP.
-- The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health
-- checks.
--
-- With Network Load Balancers, you can\'t modify this setting.
--
-- 'healthCheckTimeoutSeconds', 'modifyTargetGroup_healthCheckTimeoutSeconds' - [HTTP\/HTTPS health checks] The amount of time, in seconds, during which
-- no response means a failed health check.
--
-- With Network Load Balancers, you can\'t modify this setting.
--
-- 'healthCheckPort', 'modifyTargetGroup_healthCheckPort' - The port the load balancer uses when performing health checks on
-- targets.
--
-- 'targetGroupArn', 'modifyTargetGroup_targetGroupArn' - The Amazon Resource Name (ARN) of the target group.
newModifyTargetGroup ::
  -- | 'targetGroupArn'
  Prelude.Text ->
  ModifyTargetGroup
newModifyTargetGroup :: Text -> ModifyTargetGroup
newModifyTargetGroup Text
pTargetGroupArn_ =
  ModifyTargetGroup' :: Maybe Matcher
-> Maybe Text
-> Maybe Bool
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe ProtocolEnum
-> Maybe Natural
-> Maybe Text
-> Text
-> ModifyTargetGroup
ModifyTargetGroup'
    { $sel:matcher:ModifyTargetGroup' :: Maybe Matcher
matcher = Maybe Matcher
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPath:ModifyTargetGroup' :: Maybe Text
healthCheckPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckEnabled:ModifyTargetGroup' :: Maybe Bool
healthCheckEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:unhealthyThresholdCount:ModifyTargetGroup' :: Maybe Natural
unhealthyThresholdCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:healthyThresholdCount:ModifyTargetGroup' :: Maybe Natural
healthyThresholdCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckProtocol:ModifyTargetGroup' :: Maybe ProtocolEnum
healthCheckProtocol = Maybe ProtocolEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: Maybe Natural
healthCheckTimeoutSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPort:ModifyTargetGroup' :: Maybe Text
healthCheckPort = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetGroupArn:ModifyTargetGroup' :: Text
targetGroupArn = Text
pTargetGroupArn_
    }

-- | [HTTP\/HTTPS health checks] The HTTP or gRPC codes to use when checking
-- for a successful response from a target.
--
-- With Network Load Balancers, you can\'t modify this setting.
modifyTargetGroup_matcher :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Matcher)
modifyTargetGroup_matcher :: (Maybe Matcher -> f (Maybe Matcher))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_matcher = (ModifyTargetGroup -> Maybe Matcher)
-> (ModifyTargetGroup -> Maybe Matcher -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Matcher) (Maybe Matcher)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Matcher
matcher :: Maybe Matcher
$sel:matcher:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Matcher
matcher} -> Maybe Matcher
matcher) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Matcher
a -> ModifyTargetGroup
s {$sel:matcher:ModifyTargetGroup' :: Maybe Matcher
matcher = Maybe Matcher
a} :: ModifyTargetGroup)

-- | [HTTP\/HTTPS health checks] The destination for health checks on the
-- targets.
--
-- [HTTP1 or HTTP2 protocol version] The ping path. The default is \/.
--
-- [GRPC protocol version] The path of a custom health check method with
-- the format \/package.service\/method. The default is \/Amazon Web
-- Services.ALB\/healthcheck.
modifyTargetGroup_healthCheckPath :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Text)
modifyTargetGroup_healthCheckPath :: (Maybe Text -> f (Maybe Text))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_healthCheckPath = (ModifyTargetGroup -> Maybe Text)
-> (ModifyTargetGroup -> Maybe Text -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Text
healthCheckPath :: Maybe Text
$sel:healthCheckPath:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
healthCheckPath} -> Maybe Text
healthCheckPath) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Text
a -> ModifyTargetGroup
s {$sel:healthCheckPath:ModifyTargetGroup' :: Maybe Text
healthCheckPath = Maybe Text
a} :: ModifyTargetGroup)

-- | Indicates whether health checks are enabled.
modifyTargetGroup_healthCheckEnabled :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Bool)
modifyTargetGroup_healthCheckEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_healthCheckEnabled = (ModifyTargetGroup -> Maybe Bool)
-> (ModifyTargetGroup -> Maybe Bool -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Bool
healthCheckEnabled :: Maybe Bool
$sel:healthCheckEnabled:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Bool
healthCheckEnabled} -> Maybe Bool
healthCheckEnabled) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Bool
a -> ModifyTargetGroup
s {$sel:healthCheckEnabled:ModifyTargetGroup' :: Maybe Bool
healthCheckEnabled = Maybe Bool
a} :: ModifyTargetGroup)

-- | The number of consecutive health check failures required before
-- considering the target unhealthy. For target groups with a protocol of
-- TCP or TLS, this value must be the same as the healthy threshold count.
modifyTargetGroup_unhealthyThresholdCount :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_unhealthyThresholdCount :: (Maybe Natural -> f (Maybe Natural))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_unhealthyThresholdCount = (ModifyTargetGroup -> Maybe Natural)
-> (ModifyTargetGroup -> Maybe Natural -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Natural
unhealthyThresholdCount :: Maybe Natural
$sel:unhealthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
unhealthyThresholdCount} -> Maybe Natural
unhealthyThresholdCount) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Natural
a -> ModifyTargetGroup
s {$sel:unhealthyThresholdCount:ModifyTargetGroup' :: Maybe Natural
unhealthyThresholdCount = Maybe Natural
a} :: ModifyTargetGroup)

-- | The approximate amount of time, in seconds, between health checks of an
-- individual target. For TCP health checks, the supported values are 10 or
-- 30 seconds.
--
-- With Network Load Balancers, you can\'t modify this setting.
modifyTargetGroup_healthCheckIntervalSeconds :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_healthCheckIntervalSeconds :: (Maybe Natural -> f (Maybe Natural))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_healthCheckIntervalSeconds = (ModifyTargetGroup -> Maybe Natural)
-> (ModifyTargetGroup -> Maybe Natural -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Natural
healthCheckIntervalSeconds :: Maybe Natural
$sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
healthCheckIntervalSeconds} -> Maybe Natural
healthCheckIntervalSeconds) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Natural
a -> ModifyTargetGroup
s {$sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
a} :: ModifyTargetGroup)

-- | The number of consecutive health checks successes required before
-- considering an unhealthy target healthy.
modifyTargetGroup_healthyThresholdCount :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_healthyThresholdCount :: (Maybe Natural -> f (Maybe Natural))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_healthyThresholdCount = (ModifyTargetGroup -> Maybe Natural)
-> (ModifyTargetGroup -> Maybe Natural -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Natural
healthyThresholdCount :: Maybe Natural
$sel:healthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
healthyThresholdCount} -> Maybe Natural
healthyThresholdCount) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Natural
a -> ModifyTargetGroup
s {$sel:healthyThresholdCount:ModifyTargetGroup' :: Maybe Natural
healthyThresholdCount = Maybe Natural
a} :: ModifyTargetGroup)

-- | The protocol the load balancer uses when performing health checks on
-- targets. For Application Load Balancers, the default is HTTP. For
-- Network Load Balancers and Gateway Load Balancers, the default is TCP.
-- The TCP protocol is not supported for health checks if the protocol of
-- the target group is HTTP or HTTPS. It is supported for health checks
-- only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP.
-- The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health
-- checks.
--
-- With Network Load Balancers, you can\'t modify this setting.
modifyTargetGroup_healthCheckProtocol :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe ProtocolEnum)
modifyTargetGroup_healthCheckProtocol :: (Maybe ProtocolEnum -> f (Maybe ProtocolEnum))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_healthCheckProtocol = (ModifyTargetGroup -> Maybe ProtocolEnum)
-> (ModifyTargetGroup -> Maybe ProtocolEnum -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup
     ModifyTargetGroup
     (Maybe ProtocolEnum)
     (Maybe ProtocolEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe ProtocolEnum
healthCheckProtocol :: Maybe ProtocolEnum
$sel:healthCheckProtocol:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe ProtocolEnum
healthCheckProtocol} -> Maybe ProtocolEnum
healthCheckProtocol) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe ProtocolEnum
a -> ModifyTargetGroup
s {$sel:healthCheckProtocol:ModifyTargetGroup' :: Maybe ProtocolEnum
healthCheckProtocol = Maybe ProtocolEnum
a} :: ModifyTargetGroup)

-- | [HTTP\/HTTPS health checks] The amount of time, in seconds, during which
-- no response means a failed health check.
--
-- With Network Load Balancers, you can\'t modify this setting.
modifyTargetGroup_healthCheckTimeoutSeconds :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_healthCheckTimeoutSeconds :: (Maybe Natural -> f (Maybe Natural))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_healthCheckTimeoutSeconds = (ModifyTargetGroup -> Maybe Natural)
-> (ModifyTargetGroup -> Maybe Natural -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Natural
healthCheckTimeoutSeconds :: Maybe Natural
$sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
healthCheckTimeoutSeconds} -> Maybe Natural
healthCheckTimeoutSeconds) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Natural
a -> ModifyTargetGroup
s {$sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: Maybe Natural
healthCheckTimeoutSeconds = Maybe Natural
a} :: ModifyTargetGroup)

-- | The port the load balancer uses when performing health checks on
-- targets.
modifyTargetGroup_healthCheckPort :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Text)
modifyTargetGroup_healthCheckPort :: (Maybe Text -> f (Maybe Text))
-> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_healthCheckPort = (ModifyTargetGroup -> Maybe Text)
-> (ModifyTargetGroup -> Maybe Text -> ModifyTargetGroup)
-> Lens
     ModifyTargetGroup ModifyTargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Maybe Text
healthCheckPort :: Maybe Text
$sel:healthCheckPort:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
healthCheckPort} -> Maybe Text
healthCheckPort) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Maybe Text
a -> ModifyTargetGroup
s {$sel:healthCheckPort:ModifyTargetGroup' :: Maybe Text
healthCheckPort = Maybe Text
a} :: ModifyTargetGroup)

-- | The Amazon Resource Name (ARN) of the target group.
modifyTargetGroup_targetGroupArn :: Lens.Lens' ModifyTargetGroup Prelude.Text
modifyTargetGroup_targetGroupArn :: (Text -> f Text) -> ModifyTargetGroup -> f ModifyTargetGroup
modifyTargetGroup_targetGroupArn = (ModifyTargetGroup -> Text)
-> (ModifyTargetGroup -> Text -> ModifyTargetGroup)
-> Lens ModifyTargetGroup ModifyTargetGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroup' {Text
targetGroupArn :: Text
$sel:targetGroupArn:ModifyTargetGroup' :: ModifyTargetGroup -> Text
targetGroupArn} -> Text
targetGroupArn) (\s :: ModifyTargetGroup
s@ModifyTargetGroup' {} Text
a -> ModifyTargetGroup
s {$sel:targetGroupArn:ModifyTargetGroup' :: Text
targetGroupArn = Text
a} :: ModifyTargetGroup)

instance Core.AWSRequest ModifyTargetGroup where
  type
    AWSResponse ModifyTargetGroup =
      ModifyTargetGroupResponse
  request :: ModifyTargetGroup -> Request ModifyTargetGroup
request = Service -> ModifyTargetGroup -> Request ModifyTargetGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyTargetGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyTargetGroup)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ModifyTargetGroup))
-> Logger
-> Service
-> Proxy ModifyTargetGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyTargetGroup)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ModifyTargetGroupResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [TargetGroup] -> Int -> ModifyTargetGroupResponse
ModifyTargetGroupResponse'
            (Maybe [TargetGroup] -> Int -> ModifyTargetGroupResponse)
-> Either String (Maybe [TargetGroup])
-> Either String (Int -> ModifyTargetGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetGroups" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [TargetGroup]))
-> Either String (Maybe [TargetGroup])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [TargetGroup])
-> [Node] -> Either String (Maybe [TargetGroup])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [TargetGroup]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ModifyTargetGroupResponse)
-> Either String Int -> Either String ModifyTargetGroupResponse
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 ModifyTargetGroup

instance Prelude.NFData ModifyTargetGroup

instance Core.ToHeaders ModifyTargetGroup where
  toHeaders :: ModifyTargetGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifyTargetGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ModifyTargetGroup where
  toPath :: ModifyTargetGroup -> ByteString
toPath = ByteString -> ModifyTargetGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ModifyTargetGroup where
  toQuery :: ModifyTargetGroup -> QueryString
toQuery ModifyTargetGroup' {Maybe Bool
Maybe Natural
Maybe Text
Maybe Matcher
Maybe ProtocolEnum
Text
targetGroupArn :: Text
healthCheckPort :: Maybe Text
healthCheckTimeoutSeconds :: Maybe Natural
healthCheckProtocol :: Maybe ProtocolEnum
healthyThresholdCount :: Maybe Natural
healthCheckIntervalSeconds :: Maybe Natural
unhealthyThresholdCount :: Maybe Natural
healthCheckEnabled :: Maybe Bool
healthCheckPath :: Maybe Text
matcher :: Maybe Matcher
$sel:targetGroupArn:ModifyTargetGroup' :: ModifyTargetGroup -> Text
$sel:healthCheckPort:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckProtocol:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe ProtocolEnum
$sel:healthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:unhealthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckEnabled:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Bool
$sel:healthCheckPath:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:matcher:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Matcher
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ModifyTargetGroup" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
        ByteString
"Matcher" ByteString -> Maybe Matcher -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Matcher
matcher,
        ByteString
"HealthCheckPath" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
healthCheckPath,
        ByteString
"HealthCheckEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
healthCheckEnabled,
        ByteString
"UnhealthyThresholdCount"
          ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
unhealthyThresholdCount,
        ByteString
"HealthCheckIntervalSeconds"
          ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
healthCheckIntervalSeconds,
        ByteString
"HealthyThresholdCount"
          ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
healthyThresholdCount,
        ByteString
"HealthCheckProtocol" ByteString -> Maybe ProtocolEnum -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ProtocolEnum
healthCheckProtocol,
        ByteString
"HealthCheckTimeoutSeconds"
          ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
healthCheckTimeoutSeconds,
        ByteString
"HealthCheckPort" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
healthCheckPort,
        ByteString
"TargetGroupArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
targetGroupArn
      ]

-- | /See:/ 'newModifyTargetGroupResponse' smart constructor.
data ModifyTargetGroupResponse = ModifyTargetGroupResponse'
  { -- | Information about the modified target group.
    ModifyTargetGroupResponse -> Maybe [TargetGroup]
targetGroups :: Prelude.Maybe [TargetGroup],
    -- | The response's http status code.
    ModifyTargetGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyTargetGroupResponse -> ModifyTargetGroupResponse -> Bool
(ModifyTargetGroupResponse -> ModifyTargetGroupResponse -> Bool)
-> (ModifyTargetGroupResponse -> ModifyTargetGroupResponse -> Bool)
-> Eq ModifyTargetGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyTargetGroupResponse -> ModifyTargetGroupResponse -> Bool
$c/= :: ModifyTargetGroupResponse -> ModifyTargetGroupResponse -> Bool
== :: ModifyTargetGroupResponse -> ModifyTargetGroupResponse -> Bool
$c== :: ModifyTargetGroupResponse -> ModifyTargetGroupResponse -> Bool
Prelude.Eq, ReadPrec [ModifyTargetGroupResponse]
ReadPrec ModifyTargetGroupResponse
Int -> ReadS ModifyTargetGroupResponse
ReadS [ModifyTargetGroupResponse]
(Int -> ReadS ModifyTargetGroupResponse)
-> ReadS [ModifyTargetGroupResponse]
-> ReadPrec ModifyTargetGroupResponse
-> ReadPrec [ModifyTargetGroupResponse]
-> Read ModifyTargetGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyTargetGroupResponse]
$creadListPrec :: ReadPrec [ModifyTargetGroupResponse]
readPrec :: ReadPrec ModifyTargetGroupResponse
$creadPrec :: ReadPrec ModifyTargetGroupResponse
readList :: ReadS [ModifyTargetGroupResponse]
$creadList :: ReadS [ModifyTargetGroupResponse]
readsPrec :: Int -> ReadS ModifyTargetGroupResponse
$creadsPrec :: Int -> ReadS ModifyTargetGroupResponse
Prelude.Read, Int -> ModifyTargetGroupResponse -> ShowS
[ModifyTargetGroupResponse] -> ShowS
ModifyTargetGroupResponse -> String
(Int -> ModifyTargetGroupResponse -> ShowS)
-> (ModifyTargetGroupResponse -> String)
-> ([ModifyTargetGroupResponse] -> ShowS)
-> Show ModifyTargetGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyTargetGroupResponse] -> ShowS
$cshowList :: [ModifyTargetGroupResponse] -> ShowS
show :: ModifyTargetGroupResponse -> String
$cshow :: ModifyTargetGroupResponse -> String
showsPrec :: Int -> ModifyTargetGroupResponse -> ShowS
$cshowsPrec :: Int -> ModifyTargetGroupResponse -> ShowS
Prelude.Show, (forall x.
 ModifyTargetGroupResponse -> Rep ModifyTargetGroupResponse x)
-> (forall x.
    Rep ModifyTargetGroupResponse x -> ModifyTargetGroupResponse)
-> Generic ModifyTargetGroupResponse
forall x.
Rep ModifyTargetGroupResponse x -> ModifyTargetGroupResponse
forall x.
ModifyTargetGroupResponse -> Rep ModifyTargetGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyTargetGroupResponse x -> ModifyTargetGroupResponse
$cfrom :: forall x.
ModifyTargetGroupResponse -> Rep ModifyTargetGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyTargetGroupResponse' 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:
--
-- 'targetGroups', 'modifyTargetGroupResponse_targetGroups' - Information about the modified target group.
--
-- 'httpStatus', 'modifyTargetGroupResponse_httpStatus' - The response's http status code.
newModifyTargetGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyTargetGroupResponse
newModifyTargetGroupResponse :: Int -> ModifyTargetGroupResponse
newModifyTargetGroupResponse Int
pHttpStatus_ =
  ModifyTargetGroupResponse' :: Maybe [TargetGroup] -> Int -> ModifyTargetGroupResponse
ModifyTargetGroupResponse'
    { $sel:targetGroups:ModifyTargetGroupResponse' :: Maybe [TargetGroup]
targetGroups =
        Maybe [TargetGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyTargetGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the modified target group.
modifyTargetGroupResponse_targetGroups :: Lens.Lens' ModifyTargetGroupResponse (Prelude.Maybe [TargetGroup])
modifyTargetGroupResponse_targetGroups :: (Maybe [TargetGroup] -> f (Maybe [TargetGroup]))
-> ModifyTargetGroupResponse -> f ModifyTargetGroupResponse
modifyTargetGroupResponse_targetGroups = (ModifyTargetGroupResponse -> Maybe [TargetGroup])
-> (ModifyTargetGroupResponse
    -> Maybe [TargetGroup] -> ModifyTargetGroupResponse)
-> Lens
     ModifyTargetGroupResponse
     ModifyTargetGroupResponse
     (Maybe [TargetGroup])
     (Maybe [TargetGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroupResponse' {Maybe [TargetGroup]
targetGroups :: Maybe [TargetGroup]
$sel:targetGroups:ModifyTargetGroupResponse' :: ModifyTargetGroupResponse -> Maybe [TargetGroup]
targetGroups} -> Maybe [TargetGroup]
targetGroups) (\s :: ModifyTargetGroupResponse
s@ModifyTargetGroupResponse' {} Maybe [TargetGroup]
a -> ModifyTargetGroupResponse
s {$sel:targetGroups:ModifyTargetGroupResponse' :: Maybe [TargetGroup]
targetGroups = Maybe [TargetGroup]
a} :: ModifyTargetGroupResponse) ((Maybe [TargetGroup] -> f (Maybe [TargetGroup]))
 -> ModifyTargetGroupResponse -> f ModifyTargetGroupResponse)
-> ((Maybe [TargetGroup] -> f (Maybe [TargetGroup]))
    -> Maybe [TargetGroup] -> f (Maybe [TargetGroup]))
-> (Maybe [TargetGroup] -> f (Maybe [TargetGroup]))
-> ModifyTargetGroupResponse
-> f ModifyTargetGroupResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TargetGroup] [TargetGroup] [TargetGroup] [TargetGroup]
-> Iso
     (Maybe [TargetGroup])
     (Maybe [TargetGroup])
     (Maybe [TargetGroup])
     (Maybe [TargetGroup])
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 [TargetGroup] [TargetGroup] [TargetGroup] [TargetGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
modifyTargetGroupResponse_httpStatus :: Lens.Lens' ModifyTargetGroupResponse Prelude.Int
modifyTargetGroupResponse_httpStatus :: (Int -> f Int)
-> ModifyTargetGroupResponse -> f ModifyTargetGroupResponse
modifyTargetGroupResponse_httpStatus = (ModifyTargetGroupResponse -> Int)
-> (ModifyTargetGroupResponse -> Int -> ModifyTargetGroupResponse)
-> Lens ModifyTargetGroupResponse ModifyTargetGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTargetGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyTargetGroupResponse' :: ModifyTargetGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyTargetGroupResponse
s@ModifyTargetGroupResponse' {} Int
a -> ModifyTargetGroupResponse
s {$sel:httpStatus:ModifyTargetGroupResponse' :: Int
httpStatus = Int
a} :: ModifyTargetGroupResponse)

instance Prelude.NFData ModifyTargetGroupResponse