{-# 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.AutoScaling.TerminateInstanceInAutoScalingGroup
-- 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)
--
-- Terminates the specified instance and optionally adjusts the desired
-- group size. This operation cannot be called on instances in a warm pool.
--
-- This call simply makes a termination request. The instance is not
-- terminated immediately. When an instance is terminated, the instance
-- status changes to @terminated@. You can\'t connect to or start an
-- instance after you\'ve terminated it.
--
-- If you do not specify the option to decrement the desired capacity,
-- Amazon EC2 Auto Scaling launches instances to replace the ones that are
-- terminated.
--
-- By default, Amazon EC2 Auto Scaling balances instances across all
-- Availability Zones. If you decrement the desired capacity, your Auto
-- Scaling group can become unbalanced between Availability Zones. Amazon
-- EC2 Auto Scaling tries to rebalance the group, and rebalancing might
-- terminate instances in other zones. For more information, see
-- <https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-benefits.html#AutoScalingBehavior.InstanceUsage Rebalancing activities>
-- in the /Amazon EC2 Auto Scaling User Guide/.
module Amazonka.AutoScaling.TerminateInstanceInAutoScalingGroup
  ( -- * Creating a Request
    TerminateInstanceInAutoScalingGroup (..),
    newTerminateInstanceInAutoScalingGroup,

    -- * Request Lenses
    terminateInstanceInAutoScalingGroup_instanceId,
    terminateInstanceInAutoScalingGroup_shouldDecrementDesiredCapacity,

    -- * Destructuring the Response
    TerminateInstanceInAutoScalingGroupResponse (..),
    newTerminateInstanceInAutoScalingGroupResponse,

    -- * Response Lenses
    terminateInstanceInAutoScalingGroupResponse_activity,
    terminateInstanceInAutoScalingGroupResponse_httpStatus,
  )
where

import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
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:/ 'newTerminateInstanceInAutoScalingGroup' smart constructor.
data TerminateInstanceInAutoScalingGroup = TerminateInstanceInAutoScalingGroup'
  { -- | The ID of the instance.
    TerminateInstanceInAutoScalingGroup -> Text
instanceId :: Prelude.Text,
    -- | Indicates whether terminating the instance also decrements the size of
    -- the Auto Scaling group.
    TerminateInstanceInAutoScalingGroup -> Bool
shouldDecrementDesiredCapacity :: Prelude.Bool
  }
  deriving (TerminateInstanceInAutoScalingGroup
-> TerminateInstanceInAutoScalingGroup -> Bool
(TerminateInstanceInAutoScalingGroup
 -> TerminateInstanceInAutoScalingGroup -> Bool)
-> (TerminateInstanceInAutoScalingGroup
    -> TerminateInstanceInAutoScalingGroup -> Bool)
-> Eq TerminateInstanceInAutoScalingGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateInstanceInAutoScalingGroup
-> TerminateInstanceInAutoScalingGroup -> Bool
$c/= :: TerminateInstanceInAutoScalingGroup
-> TerminateInstanceInAutoScalingGroup -> Bool
== :: TerminateInstanceInAutoScalingGroup
-> TerminateInstanceInAutoScalingGroup -> Bool
$c== :: TerminateInstanceInAutoScalingGroup
-> TerminateInstanceInAutoScalingGroup -> Bool
Prelude.Eq, ReadPrec [TerminateInstanceInAutoScalingGroup]
ReadPrec TerminateInstanceInAutoScalingGroup
Int -> ReadS TerminateInstanceInAutoScalingGroup
ReadS [TerminateInstanceInAutoScalingGroup]
(Int -> ReadS TerminateInstanceInAutoScalingGroup)
-> ReadS [TerminateInstanceInAutoScalingGroup]
-> ReadPrec TerminateInstanceInAutoScalingGroup
-> ReadPrec [TerminateInstanceInAutoScalingGroup]
-> Read TerminateInstanceInAutoScalingGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateInstanceInAutoScalingGroup]
$creadListPrec :: ReadPrec [TerminateInstanceInAutoScalingGroup]
readPrec :: ReadPrec TerminateInstanceInAutoScalingGroup
$creadPrec :: ReadPrec TerminateInstanceInAutoScalingGroup
readList :: ReadS [TerminateInstanceInAutoScalingGroup]
$creadList :: ReadS [TerminateInstanceInAutoScalingGroup]
readsPrec :: Int -> ReadS TerminateInstanceInAutoScalingGroup
$creadsPrec :: Int -> ReadS TerminateInstanceInAutoScalingGroup
Prelude.Read, Int -> TerminateInstanceInAutoScalingGroup -> ShowS
[TerminateInstanceInAutoScalingGroup] -> ShowS
TerminateInstanceInAutoScalingGroup -> String
(Int -> TerminateInstanceInAutoScalingGroup -> ShowS)
-> (TerminateInstanceInAutoScalingGroup -> String)
-> ([TerminateInstanceInAutoScalingGroup] -> ShowS)
-> Show TerminateInstanceInAutoScalingGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateInstanceInAutoScalingGroup] -> ShowS
$cshowList :: [TerminateInstanceInAutoScalingGroup] -> ShowS
show :: TerminateInstanceInAutoScalingGroup -> String
$cshow :: TerminateInstanceInAutoScalingGroup -> String
showsPrec :: Int -> TerminateInstanceInAutoScalingGroup -> ShowS
$cshowsPrec :: Int -> TerminateInstanceInAutoScalingGroup -> ShowS
Prelude.Show, (forall x.
 TerminateInstanceInAutoScalingGroup
 -> Rep TerminateInstanceInAutoScalingGroup x)
-> (forall x.
    Rep TerminateInstanceInAutoScalingGroup x
    -> TerminateInstanceInAutoScalingGroup)
-> Generic TerminateInstanceInAutoScalingGroup
forall x.
Rep TerminateInstanceInAutoScalingGroup x
-> TerminateInstanceInAutoScalingGroup
forall x.
TerminateInstanceInAutoScalingGroup
-> Rep TerminateInstanceInAutoScalingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TerminateInstanceInAutoScalingGroup x
-> TerminateInstanceInAutoScalingGroup
$cfrom :: forall x.
TerminateInstanceInAutoScalingGroup
-> Rep TerminateInstanceInAutoScalingGroup x
Prelude.Generic)

-- |
-- Create a value of 'TerminateInstanceInAutoScalingGroup' 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:
--
-- 'instanceId', 'terminateInstanceInAutoScalingGroup_instanceId' - The ID of the instance.
--
-- 'shouldDecrementDesiredCapacity', 'terminateInstanceInAutoScalingGroup_shouldDecrementDesiredCapacity' - Indicates whether terminating the instance also decrements the size of
-- the Auto Scaling group.
newTerminateInstanceInAutoScalingGroup ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'shouldDecrementDesiredCapacity'
  Prelude.Bool ->
  TerminateInstanceInAutoScalingGroup
newTerminateInstanceInAutoScalingGroup :: Text -> Bool -> TerminateInstanceInAutoScalingGroup
newTerminateInstanceInAutoScalingGroup
  Text
pInstanceId_
  Bool
pShouldDecrementDesiredCapacity_ =
    TerminateInstanceInAutoScalingGroup' :: Text -> Bool -> TerminateInstanceInAutoScalingGroup
TerminateInstanceInAutoScalingGroup'
      { $sel:instanceId:TerminateInstanceInAutoScalingGroup' :: Text
instanceId =
          Text
pInstanceId_,
        $sel:shouldDecrementDesiredCapacity:TerminateInstanceInAutoScalingGroup' :: Bool
shouldDecrementDesiredCapacity =
          Bool
pShouldDecrementDesiredCapacity_
      }

-- | The ID of the instance.
terminateInstanceInAutoScalingGroup_instanceId :: Lens.Lens' TerminateInstanceInAutoScalingGroup Prelude.Text
terminateInstanceInAutoScalingGroup_instanceId :: (Text -> f Text)
-> TerminateInstanceInAutoScalingGroup
-> f TerminateInstanceInAutoScalingGroup
terminateInstanceInAutoScalingGroup_instanceId = (TerminateInstanceInAutoScalingGroup -> Text)
-> (TerminateInstanceInAutoScalingGroup
    -> Text -> TerminateInstanceInAutoScalingGroup)
-> Lens
     TerminateInstanceInAutoScalingGroup
     TerminateInstanceInAutoScalingGroup
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateInstanceInAutoScalingGroup' {Text
instanceId :: Text
$sel:instanceId:TerminateInstanceInAutoScalingGroup' :: TerminateInstanceInAutoScalingGroup -> Text
instanceId} -> Text
instanceId) (\s :: TerminateInstanceInAutoScalingGroup
s@TerminateInstanceInAutoScalingGroup' {} Text
a -> TerminateInstanceInAutoScalingGroup
s {$sel:instanceId:TerminateInstanceInAutoScalingGroup' :: Text
instanceId = Text
a} :: TerminateInstanceInAutoScalingGroup)

-- | Indicates whether terminating the instance also decrements the size of
-- the Auto Scaling group.
terminateInstanceInAutoScalingGroup_shouldDecrementDesiredCapacity :: Lens.Lens' TerminateInstanceInAutoScalingGroup Prelude.Bool
terminateInstanceInAutoScalingGroup_shouldDecrementDesiredCapacity :: (Bool -> f Bool)
-> TerminateInstanceInAutoScalingGroup
-> f TerminateInstanceInAutoScalingGroup
terminateInstanceInAutoScalingGroup_shouldDecrementDesiredCapacity = (TerminateInstanceInAutoScalingGroup -> Bool)
-> (TerminateInstanceInAutoScalingGroup
    -> Bool -> TerminateInstanceInAutoScalingGroup)
-> Lens
     TerminateInstanceInAutoScalingGroup
     TerminateInstanceInAutoScalingGroup
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateInstanceInAutoScalingGroup' {Bool
shouldDecrementDesiredCapacity :: Bool
$sel:shouldDecrementDesiredCapacity:TerminateInstanceInAutoScalingGroup' :: TerminateInstanceInAutoScalingGroup -> Bool
shouldDecrementDesiredCapacity} -> Bool
shouldDecrementDesiredCapacity) (\s :: TerminateInstanceInAutoScalingGroup
s@TerminateInstanceInAutoScalingGroup' {} Bool
a -> TerminateInstanceInAutoScalingGroup
s {$sel:shouldDecrementDesiredCapacity:TerminateInstanceInAutoScalingGroup' :: Bool
shouldDecrementDesiredCapacity = Bool
a} :: TerminateInstanceInAutoScalingGroup)

instance
  Core.AWSRequest
    TerminateInstanceInAutoScalingGroup
  where
  type
    AWSResponse TerminateInstanceInAutoScalingGroup =
      TerminateInstanceInAutoScalingGroupResponse
  request :: TerminateInstanceInAutoScalingGroup
-> Request TerminateInstanceInAutoScalingGroup
request = Service
-> TerminateInstanceInAutoScalingGroup
-> Request TerminateInstanceInAutoScalingGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy TerminateInstanceInAutoScalingGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse TerminateInstanceInAutoScalingGroup)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse TerminateInstanceInAutoScalingGroup))
-> Logger
-> Service
-> Proxy TerminateInstanceInAutoScalingGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse TerminateInstanceInAutoScalingGroup)))
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
"TerminateInstanceInAutoScalingGroupResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Activity
-> Int -> TerminateInstanceInAutoScalingGroupResponse
TerminateInstanceInAutoScalingGroupResponse'
            (Maybe Activity
 -> Int -> TerminateInstanceInAutoScalingGroupResponse)
-> Either String (Maybe Activity)
-> Either
     String (Int -> TerminateInstanceInAutoScalingGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Activity)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Activity")
              Either String (Int -> TerminateInstanceInAutoScalingGroupResponse)
-> Either String Int
-> Either String TerminateInstanceInAutoScalingGroupResponse
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
    TerminateInstanceInAutoScalingGroup

instance
  Prelude.NFData
    TerminateInstanceInAutoScalingGroup

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

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

instance
  Core.ToQuery
    TerminateInstanceInAutoScalingGroup
  where
  toQuery :: TerminateInstanceInAutoScalingGroup -> QueryString
toQuery TerminateInstanceInAutoScalingGroup' {Bool
Text
shouldDecrementDesiredCapacity :: Bool
instanceId :: Text
$sel:shouldDecrementDesiredCapacity:TerminateInstanceInAutoScalingGroup' :: TerminateInstanceInAutoScalingGroup -> Bool
$sel:instanceId:TerminateInstanceInAutoScalingGroup' :: TerminateInstanceInAutoScalingGroup -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"TerminateInstanceInAutoScalingGroup" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"InstanceId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
instanceId,
        ByteString
"ShouldDecrementDesiredCapacity"
          ByteString -> Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Bool
shouldDecrementDesiredCapacity
      ]

-- | /See:/ 'newTerminateInstanceInAutoScalingGroupResponse' smart constructor.
data TerminateInstanceInAutoScalingGroupResponse = TerminateInstanceInAutoScalingGroupResponse'
  { -- | A scaling activity.
    TerminateInstanceInAutoScalingGroupResponse -> Maybe Activity
activity :: Prelude.Maybe Activity,
    -- | The response's http status code.
    TerminateInstanceInAutoScalingGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (TerminateInstanceInAutoScalingGroupResponse
-> TerminateInstanceInAutoScalingGroupResponse -> Bool
(TerminateInstanceInAutoScalingGroupResponse
 -> TerminateInstanceInAutoScalingGroupResponse -> Bool)
-> (TerminateInstanceInAutoScalingGroupResponse
    -> TerminateInstanceInAutoScalingGroupResponse -> Bool)
-> Eq TerminateInstanceInAutoScalingGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateInstanceInAutoScalingGroupResponse
-> TerminateInstanceInAutoScalingGroupResponse -> Bool
$c/= :: TerminateInstanceInAutoScalingGroupResponse
-> TerminateInstanceInAutoScalingGroupResponse -> Bool
== :: TerminateInstanceInAutoScalingGroupResponse
-> TerminateInstanceInAutoScalingGroupResponse -> Bool
$c== :: TerminateInstanceInAutoScalingGroupResponse
-> TerminateInstanceInAutoScalingGroupResponse -> Bool
Prelude.Eq, ReadPrec [TerminateInstanceInAutoScalingGroupResponse]
ReadPrec TerminateInstanceInAutoScalingGroupResponse
Int -> ReadS TerminateInstanceInAutoScalingGroupResponse
ReadS [TerminateInstanceInAutoScalingGroupResponse]
(Int -> ReadS TerminateInstanceInAutoScalingGroupResponse)
-> ReadS [TerminateInstanceInAutoScalingGroupResponse]
-> ReadPrec TerminateInstanceInAutoScalingGroupResponse
-> ReadPrec [TerminateInstanceInAutoScalingGroupResponse]
-> Read TerminateInstanceInAutoScalingGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateInstanceInAutoScalingGroupResponse]
$creadListPrec :: ReadPrec [TerminateInstanceInAutoScalingGroupResponse]
readPrec :: ReadPrec TerminateInstanceInAutoScalingGroupResponse
$creadPrec :: ReadPrec TerminateInstanceInAutoScalingGroupResponse
readList :: ReadS [TerminateInstanceInAutoScalingGroupResponse]
$creadList :: ReadS [TerminateInstanceInAutoScalingGroupResponse]
readsPrec :: Int -> ReadS TerminateInstanceInAutoScalingGroupResponse
$creadsPrec :: Int -> ReadS TerminateInstanceInAutoScalingGroupResponse
Prelude.Read, Int -> TerminateInstanceInAutoScalingGroupResponse -> ShowS
[TerminateInstanceInAutoScalingGroupResponse] -> ShowS
TerminateInstanceInAutoScalingGroupResponse -> String
(Int -> TerminateInstanceInAutoScalingGroupResponse -> ShowS)
-> (TerminateInstanceInAutoScalingGroupResponse -> String)
-> ([TerminateInstanceInAutoScalingGroupResponse] -> ShowS)
-> Show TerminateInstanceInAutoScalingGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateInstanceInAutoScalingGroupResponse] -> ShowS
$cshowList :: [TerminateInstanceInAutoScalingGroupResponse] -> ShowS
show :: TerminateInstanceInAutoScalingGroupResponse -> String
$cshow :: TerminateInstanceInAutoScalingGroupResponse -> String
showsPrec :: Int -> TerminateInstanceInAutoScalingGroupResponse -> ShowS
$cshowsPrec :: Int -> TerminateInstanceInAutoScalingGroupResponse -> ShowS
Prelude.Show, (forall x.
 TerminateInstanceInAutoScalingGroupResponse
 -> Rep TerminateInstanceInAutoScalingGroupResponse x)
-> (forall x.
    Rep TerminateInstanceInAutoScalingGroupResponse x
    -> TerminateInstanceInAutoScalingGroupResponse)
-> Generic TerminateInstanceInAutoScalingGroupResponse
forall x.
Rep TerminateInstanceInAutoScalingGroupResponse x
-> TerminateInstanceInAutoScalingGroupResponse
forall x.
TerminateInstanceInAutoScalingGroupResponse
-> Rep TerminateInstanceInAutoScalingGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TerminateInstanceInAutoScalingGroupResponse x
-> TerminateInstanceInAutoScalingGroupResponse
$cfrom :: forall x.
TerminateInstanceInAutoScalingGroupResponse
-> Rep TerminateInstanceInAutoScalingGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'TerminateInstanceInAutoScalingGroupResponse' 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:
--
-- 'activity', 'terminateInstanceInAutoScalingGroupResponse_activity' - A scaling activity.
--
-- 'httpStatus', 'terminateInstanceInAutoScalingGroupResponse_httpStatus' - The response's http status code.
newTerminateInstanceInAutoScalingGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TerminateInstanceInAutoScalingGroupResponse
newTerminateInstanceInAutoScalingGroupResponse :: Int -> TerminateInstanceInAutoScalingGroupResponse
newTerminateInstanceInAutoScalingGroupResponse
  Int
pHttpStatus_ =
    TerminateInstanceInAutoScalingGroupResponse' :: Maybe Activity
-> Int -> TerminateInstanceInAutoScalingGroupResponse
TerminateInstanceInAutoScalingGroupResponse'
      { $sel:activity:TerminateInstanceInAutoScalingGroupResponse' :: Maybe Activity
activity =
          Maybe Activity
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:TerminateInstanceInAutoScalingGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A scaling activity.
terminateInstanceInAutoScalingGroupResponse_activity :: Lens.Lens' TerminateInstanceInAutoScalingGroupResponse (Prelude.Maybe Activity)
terminateInstanceInAutoScalingGroupResponse_activity :: (Maybe Activity -> f (Maybe Activity))
-> TerminateInstanceInAutoScalingGroupResponse
-> f TerminateInstanceInAutoScalingGroupResponse
terminateInstanceInAutoScalingGroupResponse_activity = (TerminateInstanceInAutoScalingGroupResponse -> Maybe Activity)
-> (TerminateInstanceInAutoScalingGroupResponse
    -> Maybe Activity -> TerminateInstanceInAutoScalingGroupResponse)
-> Lens
     TerminateInstanceInAutoScalingGroupResponse
     TerminateInstanceInAutoScalingGroupResponse
     (Maybe Activity)
     (Maybe Activity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateInstanceInAutoScalingGroupResponse' {Maybe Activity
activity :: Maybe Activity
$sel:activity:TerminateInstanceInAutoScalingGroupResponse' :: TerminateInstanceInAutoScalingGroupResponse -> Maybe Activity
activity} -> Maybe Activity
activity) (\s :: TerminateInstanceInAutoScalingGroupResponse
s@TerminateInstanceInAutoScalingGroupResponse' {} Maybe Activity
a -> TerminateInstanceInAutoScalingGroupResponse
s {$sel:activity:TerminateInstanceInAutoScalingGroupResponse' :: Maybe Activity
activity = Maybe Activity
a} :: TerminateInstanceInAutoScalingGroupResponse)

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

instance
  Prelude.NFData
    TerminateInstanceInAutoScalingGroupResponse