{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_healthCheckEnabled,
    modifyTargetGroup_healthCheckIntervalSeconds,
    modifyTargetGroup_healthCheckPath,
    modifyTargetGroup_healthCheckPort,
    modifyTargetGroup_healthCheckProtocol,
    modifyTargetGroup_healthCheckTimeoutSeconds,
    modifyTargetGroup_healthyThresholdCount,
    modifyTargetGroup_matcher,
    modifyTargetGroup_unhealthyThresholdCount,
    modifyTargetGroup_targetGroupArn,

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

    -- * Response Lenses
    modifyTargetGroupResponse_targetGroups,
    modifyTargetGroupResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ELBV2.Types
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'
  { -- | Indicates whether health checks are enabled.
    ModifyTargetGroup -> Maybe Bool
healthCheckEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The approximate amount of time, in seconds, between health checks of an
    -- individual target.
    ModifyTargetGroup -> Maybe Natural
healthCheckIntervalSeconds :: Prelude.Maybe Prelude.Natural,
    -- | [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,
    -- | The port the load balancer uses when performing health checks on
    -- targets.
    ModifyTargetGroup -> Maybe Text
healthCheckPort :: Prelude.Maybe Prelude.Text,
    -- | 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.
    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.
    ModifyTargetGroup -> Maybe Natural
healthCheckTimeoutSeconds :: 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,
    -- | [HTTP\/HTTPS health checks] The HTTP or gRPC codes to use when checking
    -- for a successful response from a target. For target groups with a
    -- protocol of TCP, TCP_UDP, UDP or TLS the range is 200-599. For target
    -- groups with a protocol of HTTP or HTTPS, the range is 200-499. For
    -- target groups with a protocol of GENEVE, the range is 200-399.
    ModifyTargetGroup -> Maybe Matcher
matcher :: Prelude.Maybe Matcher,
    -- | The number of consecutive health check failures required before
    -- considering the target unhealthy.
    ModifyTargetGroup -> Maybe Natural
unhealthyThresholdCount :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the target group.
    ModifyTargetGroup -> Text
targetGroupArn :: Prelude.Text
  }
  deriving (ModifyTargetGroup -> ModifyTargetGroup -> Bool
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]
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
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. 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:
--
-- 'healthCheckEnabled', 'modifyTargetGroup_healthCheckEnabled' - Indicates whether health checks are enabled.
--
-- 'healthCheckIntervalSeconds', 'modifyTargetGroup_healthCheckIntervalSeconds' - The approximate amount of time, in seconds, between health checks of an
-- individual target.
--
-- '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.
--
-- 'healthCheckPort', 'modifyTargetGroup_healthCheckPort' - The port the load balancer uses when performing health checks on
-- targets.
--
-- '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.
--
-- 'healthCheckTimeoutSeconds', 'modifyTargetGroup_healthCheckTimeoutSeconds' - [HTTP\/HTTPS health checks] The amount of time, in seconds, during which
-- no response means a failed health check.
--
-- 'healthyThresholdCount', 'modifyTargetGroup_healthyThresholdCount' - The number of consecutive health checks successes required before
-- considering an unhealthy target healthy.
--
-- 'matcher', 'modifyTargetGroup_matcher' - [HTTP\/HTTPS health checks] The HTTP or gRPC codes to use when checking
-- for a successful response from a target. For target groups with a
-- protocol of TCP, TCP_UDP, UDP or TLS the range is 200-599. For target
-- groups with a protocol of HTTP or HTTPS, the range is 200-499. For
-- target groups with a protocol of GENEVE, the range is 200-399.
--
-- 'unhealthyThresholdCount', 'modifyTargetGroup_unhealthyThresholdCount' - The number of consecutive health check failures required before
-- considering the target unhealthy.
--
-- 'targetGroupArn', 'modifyTargetGroup_targetGroupArn' - The Amazon Resource Name (ARN) of the target group.
newModifyTargetGroup ::
  -- | 'targetGroupArn'
  Prelude.Text ->
  ModifyTargetGroup
newModifyTargetGroup :: Text -> ModifyTargetGroup
newModifyTargetGroup Text
pTargetGroupArn_ =
  ModifyTargetGroup'
    { $sel:healthCheckEnabled:ModifyTargetGroup' :: Maybe Bool
healthCheckEnabled =
        forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: Maybe Natural
healthCheckIntervalSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPath:ModifyTargetGroup' :: Maybe Text
healthCheckPath = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPort:ModifyTargetGroup' :: Maybe Text
healthCheckPort = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckProtocol:ModifyTargetGroup' :: Maybe ProtocolEnum
healthCheckProtocol = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: Maybe Natural
healthCheckTimeoutSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:healthyThresholdCount:ModifyTargetGroup' :: Maybe Natural
healthyThresholdCount = forall a. Maybe a
Prelude.Nothing,
      $sel:matcher:ModifyTargetGroup' :: Maybe Matcher
matcher = forall a. Maybe a
Prelude.Nothing,
      $sel:unhealthyThresholdCount:ModifyTargetGroup' :: Maybe Natural
unhealthyThresholdCount = forall a. Maybe a
Prelude.Nothing,
      $sel:targetGroupArn:ModifyTargetGroup' :: Text
targetGroupArn = Text
pTargetGroupArn_
    }

-- | Indicates whether health checks are enabled.
modifyTargetGroup_healthCheckEnabled :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Bool)
modifyTargetGroup_healthCheckEnabled :: Lens' ModifyTargetGroup (Maybe Bool)
modifyTargetGroup_healthCheckEnabled = 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 approximate amount of time, in seconds, between health checks of an
-- individual target.
modifyTargetGroup_healthCheckIntervalSeconds :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_healthCheckIntervalSeconds :: Lens' ModifyTargetGroup (Maybe Natural)
modifyTargetGroup_healthCheckIntervalSeconds = 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)

-- | [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 :: Lens' ModifyTargetGroup (Maybe Text)
modifyTargetGroup_healthCheckPath = 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)

-- | The port the load balancer uses when performing health checks on
-- targets.
modifyTargetGroup_healthCheckPort :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Text)
modifyTargetGroup_healthCheckPort :: Lens' ModifyTargetGroup (Maybe Text)
modifyTargetGroup_healthCheckPort = 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 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.
modifyTargetGroup_healthCheckProtocol :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe ProtocolEnum)
modifyTargetGroup_healthCheckProtocol :: Lens' ModifyTargetGroup (Maybe ProtocolEnum)
modifyTargetGroup_healthCheckProtocol = 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.
modifyTargetGroup_healthCheckTimeoutSeconds :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_healthCheckTimeoutSeconds :: Lens' ModifyTargetGroup (Maybe Natural)
modifyTargetGroup_healthCheckTimeoutSeconds = 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 number of consecutive health checks successes required before
-- considering an unhealthy target healthy.
modifyTargetGroup_healthyThresholdCount :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_healthyThresholdCount :: Lens' ModifyTargetGroup (Maybe Natural)
modifyTargetGroup_healthyThresholdCount = 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)

-- | [HTTP\/HTTPS health checks] The HTTP or gRPC codes to use when checking
-- for a successful response from a target. For target groups with a
-- protocol of TCP, TCP_UDP, UDP or TLS the range is 200-599. For target
-- groups with a protocol of HTTP or HTTPS, the range is 200-499. For
-- target groups with a protocol of GENEVE, the range is 200-399.
modifyTargetGroup_matcher :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Matcher)
modifyTargetGroup_matcher :: Lens' ModifyTargetGroup (Maybe Matcher)
modifyTargetGroup_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)

-- | The number of consecutive health check failures required before
-- considering the target unhealthy.
modifyTargetGroup_unhealthyThresholdCount :: Lens.Lens' ModifyTargetGroup (Prelude.Maybe Prelude.Natural)
modifyTargetGroup_unhealthyThresholdCount :: Lens' ModifyTargetGroup (Maybe Natural)
modifyTargetGroup_unhealthyThresholdCount = 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 Amazon Resource Name (ARN) of the target group.
modifyTargetGroup_targetGroupArn :: Lens.Lens' ModifyTargetGroup Prelude.Text
modifyTargetGroup_targetGroupArn :: Lens' ModifyTargetGroup Text
modifyTargetGroup_targetGroupArn = 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 :: (Service -> Service)
-> ModifyTargetGroup -> Request ModifyTargetGroup
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifyTargetGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyTargetGroup)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TargetGroups"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ModifyTargetGroup where
  hashWithSalt :: Int -> ModifyTargetGroup -> Int
hashWithSalt Int
_salt ModifyTargetGroup' {Maybe Bool
Maybe Natural
Maybe Text
Maybe Matcher
Maybe ProtocolEnum
Text
targetGroupArn :: Text
unhealthyThresholdCount :: Maybe Natural
matcher :: Maybe Matcher
healthyThresholdCount :: Maybe Natural
healthCheckTimeoutSeconds :: Maybe Natural
healthCheckProtocol :: Maybe ProtocolEnum
healthCheckPort :: Maybe Text
healthCheckPath :: Maybe Text
healthCheckIntervalSeconds :: Maybe Natural
healthCheckEnabled :: Maybe Bool
$sel:targetGroupArn:ModifyTargetGroup' :: ModifyTargetGroup -> Text
$sel:unhealthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:matcher:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Matcher
$sel:healthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckProtocol:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe ProtocolEnum
$sel:healthCheckPort:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:healthCheckPath:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckEnabled:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
healthCheckEnabled
      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 Text
healthCheckPort
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProtocolEnum
healthCheckProtocol
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
healthCheckTimeoutSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
healthyThresholdCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Matcher
matcher
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
unhealthyThresholdCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
targetGroupArn

instance Prelude.NFData ModifyTargetGroup where
  rnf :: ModifyTargetGroup -> ()
rnf ModifyTargetGroup' {Maybe Bool
Maybe Natural
Maybe Text
Maybe Matcher
Maybe ProtocolEnum
Text
targetGroupArn :: Text
unhealthyThresholdCount :: Maybe Natural
matcher :: Maybe Matcher
healthyThresholdCount :: Maybe Natural
healthCheckTimeoutSeconds :: Maybe Natural
healthCheckProtocol :: Maybe ProtocolEnum
healthCheckPort :: Maybe Text
healthCheckPath :: Maybe Text
healthCheckIntervalSeconds :: Maybe Natural
healthCheckEnabled :: Maybe Bool
$sel:targetGroupArn:ModifyTargetGroup' :: ModifyTargetGroup -> Text
$sel:unhealthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:matcher:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Matcher
$sel:healthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckProtocol:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe ProtocolEnum
$sel:healthCheckPort:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:healthCheckPath:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckEnabled:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
healthCheckEnabled
      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 Text
healthCheckPort
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProtocolEnum
healthCheckProtocol
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
healthCheckTimeoutSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
healthyThresholdCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Matcher
matcher
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
unhealthyThresholdCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
targetGroupArn

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

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

instance Data.ToQuery ModifyTargetGroup where
  toQuery :: ModifyTargetGroup -> QueryString
toQuery ModifyTargetGroup' {Maybe Bool
Maybe Natural
Maybe Text
Maybe Matcher
Maybe ProtocolEnum
Text
targetGroupArn :: Text
unhealthyThresholdCount :: Maybe Natural
matcher :: Maybe Matcher
healthyThresholdCount :: Maybe Natural
healthCheckTimeoutSeconds :: Maybe Natural
healthCheckProtocol :: Maybe ProtocolEnum
healthCheckPort :: Maybe Text
healthCheckPath :: Maybe Text
healthCheckIntervalSeconds :: Maybe Natural
healthCheckEnabled :: Maybe Bool
$sel:targetGroupArn:ModifyTargetGroup' :: ModifyTargetGroup -> Text
$sel:unhealthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:matcher:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Matcher
$sel:healthyThresholdCount:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckTimeoutSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckProtocol:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe ProtocolEnum
$sel:healthCheckPort:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:healthCheckPath:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Text
$sel:healthCheckIntervalSeconds:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Natural
$sel:healthCheckEnabled:ModifyTargetGroup' :: ModifyTargetGroup -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyTargetGroup" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
        ByteString
"HealthCheckEnabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
healthCheckEnabled,
        ByteString
"HealthCheckIntervalSeconds"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
healthCheckIntervalSeconds,
        ByteString
"HealthCheckPath" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
healthCheckPath,
        ByteString
"HealthCheckPort" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
healthCheckPort,
        ByteString
"HealthCheckProtocol" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ProtocolEnum
healthCheckProtocol,
        ByteString
"HealthCheckTimeoutSeconds"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
healthCheckTimeoutSeconds,
        ByteString
"HealthyThresholdCount"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
healthyThresholdCount,
        ByteString
"Matcher" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Matcher
matcher,
        ByteString
"UnhealthyThresholdCount"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
unhealthyThresholdCount,
        ByteString
"TargetGroupArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
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]
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
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.
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'
    { $sel:targetGroups:ModifyTargetGroupResponse' :: Maybe [TargetGroup]
targetGroups =
        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 :: Lens' ModifyTargetGroupResponse (Maybe [TargetGroup])
modifyTargetGroupResponse_targetGroups = 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) 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 response's http status code.
modifyTargetGroupResponse_httpStatus :: Lens.Lens' ModifyTargetGroupResponse Prelude.Int
modifyTargetGroupResponse_httpStatus :: Lens' ModifyTargetGroupResponse Int
modifyTargetGroupResponse_httpStatus = 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 where
  rnf :: ModifyTargetGroupResponse -> ()
rnf ModifyTargetGroupResponse' {Int
Maybe [TargetGroup]
httpStatus :: Int
targetGroups :: Maybe [TargetGroup]
$sel:httpStatus:ModifyTargetGroupResponse' :: ModifyTargetGroupResponse -> Int
$sel:targetGroups:ModifyTargetGroupResponse' :: ModifyTargetGroupResponse -> Maybe [TargetGroup]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [TargetGroup]
targetGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus