{-# 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.ELB.RegisterInstancesWithLoadBalancer
-- 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)
--
-- Adds the specified instances to the specified load balancer.
--
-- The instance must be a running instance in the same network as the load
-- balancer (EC2-Classic or the same VPC). If you have EC2-Classic
-- instances and a load balancer in a VPC with ClassicLink enabled, you can
-- link the EC2-Classic instances to that VPC and then register the linked
-- EC2-Classic instances with the load balancer in the VPC.
--
-- Note that @RegisterInstanceWithLoadBalancer@ completes when the request
-- has been registered. Instance registration takes a little time to
-- complete. To check the state of the registered instances, use
-- DescribeLoadBalancers or DescribeInstanceHealth.
--
-- After the instance is registered, it starts receiving traffic and
-- requests from the load balancer. Any instance that is not in one of the
-- Availability Zones registered for the load balancer is moved to the
-- @OutOfService@ state. If an Availability Zone is added to the load
-- balancer later, any instances registered with the load balancer move to
-- the @InService@ state.
--
-- To deregister instances from a load balancer, use
-- DeregisterInstancesFromLoadBalancer.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html Register or De-Register EC2 Instances>
-- in the /Classic Load Balancers Guide/.
module Amazonka.ELB.RegisterInstancesWithLoadBalancer
  ( -- * Creating a Request
    RegisterInstancesWithLoadBalancer (..),
    newRegisterInstancesWithLoadBalancer,

    -- * Request Lenses
    registerInstancesWithLoadBalancer_loadBalancerName,
    registerInstancesWithLoadBalancer_instances,

    -- * Destructuring the Response
    RegisterInstancesWithLoadBalancerResponse (..),
    newRegisterInstancesWithLoadBalancerResponse,

    -- * Response Lenses
    registerInstancesWithLoadBalancerResponse_instances,
    registerInstancesWithLoadBalancerResponse_httpStatus,
  )
where

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

-- | Contains the parameters for RegisterInstancesWithLoadBalancer.
--
-- /See:/ 'newRegisterInstancesWithLoadBalancer' smart constructor.
data RegisterInstancesWithLoadBalancer = RegisterInstancesWithLoadBalancer'
  { -- | The name of the load balancer.
    RegisterInstancesWithLoadBalancer -> Text
loadBalancerName :: Prelude.Text,
    -- | The IDs of the instances.
    RegisterInstancesWithLoadBalancer -> [Instance]
instances :: [Instance]
  }
  deriving (RegisterInstancesWithLoadBalancer
-> RegisterInstancesWithLoadBalancer -> Bool
(RegisterInstancesWithLoadBalancer
 -> RegisterInstancesWithLoadBalancer -> Bool)
-> (RegisterInstancesWithLoadBalancer
    -> RegisterInstancesWithLoadBalancer -> Bool)
-> Eq RegisterInstancesWithLoadBalancer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterInstancesWithLoadBalancer
-> RegisterInstancesWithLoadBalancer -> Bool
$c/= :: RegisterInstancesWithLoadBalancer
-> RegisterInstancesWithLoadBalancer -> Bool
== :: RegisterInstancesWithLoadBalancer
-> RegisterInstancesWithLoadBalancer -> Bool
$c== :: RegisterInstancesWithLoadBalancer
-> RegisterInstancesWithLoadBalancer -> Bool
Prelude.Eq, ReadPrec [RegisterInstancesWithLoadBalancer]
ReadPrec RegisterInstancesWithLoadBalancer
Int -> ReadS RegisterInstancesWithLoadBalancer
ReadS [RegisterInstancesWithLoadBalancer]
(Int -> ReadS RegisterInstancesWithLoadBalancer)
-> ReadS [RegisterInstancesWithLoadBalancer]
-> ReadPrec RegisterInstancesWithLoadBalancer
-> ReadPrec [RegisterInstancesWithLoadBalancer]
-> Read RegisterInstancesWithLoadBalancer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterInstancesWithLoadBalancer]
$creadListPrec :: ReadPrec [RegisterInstancesWithLoadBalancer]
readPrec :: ReadPrec RegisterInstancesWithLoadBalancer
$creadPrec :: ReadPrec RegisterInstancesWithLoadBalancer
readList :: ReadS [RegisterInstancesWithLoadBalancer]
$creadList :: ReadS [RegisterInstancesWithLoadBalancer]
readsPrec :: Int -> ReadS RegisterInstancesWithLoadBalancer
$creadsPrec :: Int -> ReadS RegisterInstancesWithLoadBalancer
Prelude.Read, Int -> RegisterInstancesWithLoadBalancer -> ShowS
[RegisterInstancesWithLoadBalancer] -> ShowS
RegisterInstancesWithLoadBalancer -> String
(Int -> RegisterInstancesWithLoadBalancer -> ShowS)
-> (RegisterInstancesWithLoadBalancer -> String)
-> ([RegisterInstancesWithLoadBalancer] -> ShowS)
-> Show RegisterInstancesWithLoadBalancer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterInstancesWithLoadBalancer] -> ShowS
$cshowList :: [RegisterInstancesWithLoadBalancer] -> ShowS
show :: RegisterInstancesWithLoadBalancer -> String
$cshow :: RegisterInstancesWithLoadBalancer -> String
showsPrec :: Int -> RegisterInstancesWithLoadBalancer -> ShowS
$cshowsPrec :: Int -> RegisterInstancesWithLoadBalancer -> ShowS
Prelude.Show, (forall x.
 RegisterInstancesWithLoadBalancer
 -> Rep RegisterInstancesWithLoadBalancer x)
-> (forall x.
    Rep RegisterInstancesWithLoadBalancer x
    -> RegisterInstancesWithLoadBalancer)
-> Generic RegisterInstancesWithLoadBalancer
forall x.
Rep RegisterInstancesWithLoadBalancer x
-> RegisterInstancesWithLoadBalancer
forall x.
RegisterInstancesWithLoadBalancer
-> Rep RegisterInstancesWithLoadBalancer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterInstancesWithLoadBalancer x
-> RegisterInstancesWithLoadBalancer
$cfrom :: forall x.
RegisterInstancesWithLoadBalancer
-> Rep RegisterInstancesWithLoadBalancer x
Prelude.Generic)

-- |
-- Create a value of 'RegisterInstancesWithLoadBalancer' 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:
--
-- 'loadBalancerName', 'registerInstancesWithLoadBalancer_loadBalancerName' - The name of the load balancer.
--
-- 'instances', 'registerInstancesWithLoadBalancer_instances' - The IDs of the instances.
newRegisterInstancesWithLoadBalancer ::
  -- | 'loadBalancerName'
  Prelude.Text ->
  RegisterInstancesWithLoadBalancer
newRegisterInstancesWithLoadBalancer :: Text -> RegisterInstancesWithLoadBalancer
newRegisterInstancesWithLoadBalancer
  Text
pLoadBalancerName_ =
    RegisterInstancesWithLoadBalancer' :: Text -> [Instance] -> RegisterInstancesWithLoadBalancer
RegisterInstancesWithLoadBalancer'
      { $sel:loadBalancerName:RegisterInstancesWithLoadBalancer' :: Text
loadBalancerName =
          Text
pLoadBalancerName_,
        $sel:instances:RegisterInstancesWithLoadBalancer' :: [Instance]
instances = [Instance]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The name of the load balancer.
registerInstancesWithLoadBalancer_loadBalancerName :: Lens.Lens' RegisterInstancesWithLoadBalancer Prelude.Text
registerInstancesWithLoadBalancer_loadBalancerName :: (Text -> f Text)
-> RegisterInstancesWithLoadBalancer
-> f RegisterInstancesWithLoadBalancer
registerInstancesWithLoadBalancer_loadBalancerName = (RegisterInstancesWithLoadBalancer -> Text)
-> (RegisterInstancesWithLoadBalancer
    -> Text -> RegisterInstancesWithLoadBalancer)
-> Lens
     RegisterInstancesWithLoadBalancer
     RegisterInstancesWithLoadBalancer
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterInstancesWithLoadBalancer' {Text
loadBalancerName :: Text
$sel:loadBalancerName:RegisterInstancesWithLoadBalancer' :: RegisterInstancesWithLoadBalancer -> Text
loadBalancerName} -> Text
loadBalancerName) (\s :: RegisterInstancesWithLoadBalancer
s@RegisterInstancesWithLoadBalancer' {} Text
a -> RegisterInstancesWithLoadBalancer
s {$sel:loadBalancerName:RegisterInstancesWithLoadBalancer' :: Text
loadBalancerName = Text
a} :: RegisterInstancesWithLoadBalancer)

-- | The IDs of the instances.
registerInstancesWithLoadBalancer_instances :: Lens.Lens' RegisterInstancesWithLoadBalancer [Instance]
registerInstancesWithLoadBalancer_instances :: ([Instance] -> f [Instance])
-> RegisterInstancesWithLoadBalancer
-> f RegisterInstancesWithLoadBalancer
registerInstancesWithLoadBalancer_instances = (RegisterInstancesWithLoadBalancer -> [Instance])
-> (RegisterInstancesWithLoadBalancer
    -> [Instance] -> RegisterInstancesWithLoadBalancer)
-> Lens
     RegisterInstancesWithLoadBalancer
     RegisterInstancesWithLoadBalancer
     [Instance]
     [Instance]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterInstancesWithLoadBalancer' {[Instance]
instances :: [Instance]
$sel:instances:RegisterInstancesWithLoadBalancer' :: RegisterInstancesWithLoadBalancer -> [Instance]
instances} -> [Instance]
instances) (\s :: RegisterInstancesWithLoadBalancer
s@RegisterInstancesWithLoadBalancer' {} [Instance]
a -> RegisterInstancesWithLoadBalancer
s {$sel:instances:RegisterInstancesWithLoadBalancer' :: [Instance]
instances = [Instance]
a} :: RegisterInstancesWithLoadBalancer) (([Instance] -> f [Instance])
 -> RegisterInstancesWithLoadBalancer
 -> f RegisterInstancesWithLoadBalancer)
-> (([Instance] -> f [Instance]) -> [Instance] -> f [Instance])
-> ([Instance] -> f [Instance])
-> RegisterInstancesWithLoadBalancer
-> f RegisterInstancesWithLoadBalancer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Instance] -> f [Instance]) -> [Instance] -> f [Instance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    RegisterInstancesWithLoadBalancer
  where
  type
    AWSResponse RegisterInstancesWithLoadBalancer =
      RegisterInstancesWithLoadBalancerResponse
  request :: RegisterInstancesWithLoadBalancer
-> Request RegisterInstancesWithLoadBalancer
request = Service
-> RegisterInstancesWithLoadBalancer
-> Request RegisterInstancesWithLoadBalancer
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy RegisterInstancesWithLoadBalancer
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse RegisterInstancesWithLoadBalancer)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse RegisterInstancesWithLoadBalancer))
-> Logger
-> Service
-> Proxy RegisterInstancesWithLoadBalancer
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse RegisterInstancesWithLoadBalancer)))
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
"RegisterInstancesWithLoadBalancerResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [Instance]
-> Int -> RegisterInstancesWithLoadBalancerResponse
RegisterInstancesWithLoadBalancerResponse'
            (Maybe [Instance]
 -> Int -> RegisterInstancesWithLoadBalancerResponse)
-> Either String (Maybe [Instance])
-> Either String (Int -> RegisterInstancesWithLoadBalancerResponse)
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
"Instances" 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 [Instance]))
-> Either String (Maybe [Instance])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Instance])
-> [Node] -> Either String (Maybe [Instance])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Instance]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
              Either String (Int -> RegisterInstancesWithLoadBalancerResponse)
-> Either String Int
-> Either String RegisterInstancesWithLoadBalancerResponse
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
    RegisterInstancesWithLoadBalancer

instance
  Prelude.NFData
    RegisterInstancesWithLoadBalancer

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

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

instance
  Core.ToQuery
    RegisterInstancesWithLoadBalancer
  where
  toQuery :: RegisterInstancesWithLoadBalancer -> QueryString
toQuery RegisterInstancesWithLoadBalancer' {[Instance]
Text
instances :: [Instance]
loadBalancerName :: Text
$sel:instances:RegisterInstancesWithLoadBalancer' :: RegisterInstancesWithLoadBalancer -> [Instance]
$sel:loadBalancerName:RegisterInstancesWithLoadBalancer' :: RegisterInstancesWithLoadBalancer -> 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
"RegisterInstancesWithLoadBalancer" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-06-01" :: Prelude.ByteString),
        ByteString
"LoadBalancerName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
loadBalancerName,
        ByteString
"Instances"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Instance] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Instance]
instances
      ]

-- | Contains the output of RegisterInstancesWithLoadBalancer.
--
-- /See:/ 'newRegisterInstancesWithLoadBalancerResponse' smart constructor.
data RegisterInstancesWithLoadBalancerResponse = RegisterInstancesWithLoadBalancerResponse'
  { -- | The updated list of instances for the load balancer.
    RegisterInstancesWithLoadBalancerResponse -> Maybe [Instance]
instances :: Prelude.Maybe [Instance],
    -- | The response's http status code.
    RegisterInstancesWithLoadBalancerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RegisterInstancesWithLoadBalancerResponse
-> RegisterInstancesWithLoadBalancerResponse -> Bool
(RegisterInstancesWithLoadBalancerResponse
 -> RegisterInstancesWithLoadBalancerResponse -> Bool)
-> (RegisterInstancesWithLoadBalancerResponse
    -> RegisterInstancesWithLoadBalancerResponse -> Bool)
-> Eq RegisterInstancesWithLoadBalancerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterInstancesWithLoadBalancerResponse
-> RegisterInstancesWithLoadBalancerResponse -> Bool
$c/= :: RegisterInstancesWithLoadBalancerResponse
-> RegisterInstancesWithLoadBalancerResponse -> Bool
== :: RegisterInstancesWithLoadBalancerResponse
-> RegisterInstancesWithLoadBalancerResponse -> Bool
$c== :: RegisterInstancesWithLoadBalancerResponse
-> RegisterInstancesWithLoadBalancerResponse -> Bool
Prelude.Eq, ReadPrec [RegisterInstancesWithLoadBalancerResponse]
ReadPrec RegisterInstancesWithLoadBalancerResponse
Int -> ReadS RegisterInstancesWithLoadBalancerResponse
ReadS [RegisterInstancesWithLoadBalancerResponse]
(Int -> ReadS RegisterInstancesWithLoadBalancerResponse)
-> ReadS [RegisterInstancesWithLoadBalancerResponse]
-> ReadPrec RegisterInstancesWithLoadBalancerResponse
-> ReadPrec [RegisterInstancesWithLoadBalancerResponse]
-> Read RegisterInstancesWithLoadBalancerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterInstancesWithLoadBalancerResponse]
$creadListPrec :: ReadPrec [RegisterInstancesWithLoadBalancerResponse]
readPrec :: ReadPrec RegisterInstancesWithLoadBalancerResponse
$creadPrec :: ReadPrec RegisterInstancesWithLoadBalancerResponse
readList :: ReadS [RegisterInstancesWithLoadBalancerResponse]
$creadList :: ReadS [RegisterInstancesWithLoadBalancerResponse]
readsPrec :: Int -> ReadS RegisterInstancesWithLoadBalancerResponse
$creadsPrec :: Int -> ReadS RegisterInstancesWithLoadBalancerResponse
Prelude.Read, Int -> RegisterInstancesWithLoadBalancerResponse -> ShowS
[RegisterInstancesWithLoadBalancerResponse] -> ShowS
RegisterInstancesWithLoadBalancerResponse -> String
(Int -> RegisterInstancesWithLoadBalancerResponse -> ShowS)
-> (RegisterInstancesWithLoadBalancerResponse -> String)
-> ([RegisterInstancesWithLoadBalancerResponse] -> ShowS)
-> Show RegisterInstancesWithLoadBalancerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterInstancesWithLoadBalancerResponse] -> ShowS
$cshowList :: [RegisterInstancesWithLoadBalancerResponse] -> ShowS
show :: RegisterInstancesWithLoadBalancerResponse -> String
$cshow :: RegisterInstancesWithLoadBalancerResponse -> String
showsPrec :: Int -> RegisterInstancesWithLoadBalancerResponse -> ShowS
$cshowsPrec :: Int -> RegisterInstancesWithLoadBalancerResponse -> ShowS
Prelude.Show, (forall x.
 RegisterInstancesWithLoadBalancerResponse
 -> Rep RegisterInstancesWithLoadBalancerResponse x)
-> (forall x.
    Rep RegisterInstancesWithLoadBalancerResponse x
    -> RegisterInstancesWithLoadBalancerResponse)
-> Generic RegisterInstancesWithLoadBalancerResponse
forall x.
Rep RegisterInstancesWithLoadBalancerResponse x
-> RegisterInstancesWithLoadBalancerResponse
forall x.
RegisterInstancesWithLoadBalancerResponse
-> Rep RegisterInstancesWithLoadBalancerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterInstancesWithLoadBalancerResponse x
-> RegisterInstancesWithLoadBalancerResponse
$cfrom :: forall x.
RegisterInstancesWithLoadBalancerResponse
-> Rep RegisterInstancesWithLoadBalancerResponse x
Prelude.Generic)

-- |
-- Create a value of 'RegisterInstancesWithLoadBalancerResponse' 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:
--
-- 'instances', 'registerInstancesWithLoadBalancerResponse_instances' - The updated list of instances for the load balancer.
--
-- 'httpStatus', 'registerInstancesWithLoadBalancerResponse_httpStatus' - The response's http status code.
newRegisterInstancesWithLoadBalancerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RegisterInstancesWithLoadBalancerResponse
newRegisterInstancesWithLoadBalancerResponse :: Int -> RegisterInstancesWithLoadBalancerResponse
newRegisterInstancesWithLoadBalancerResponse
  Int
pHttpStatus_ =
    RegisterInstancesWithLoadBalancerResponse' :: Maybe [Instance]
-> Int -> RegisterInstancesWithLoadBalancerResponse
RegisterInstancesWithLoadBalancerResponse'
      { $sel:instances:RegisterInstancesWithLoadBalancerResponse' :: Maybe [Instance]
instances =
          Maybe [Instance]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:RegisterInstancesWithLoadBalancerResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The updated list of instances for the load balancer.
registerInstancesWithLoadBalancerResponse_instances :: Lens.Lens' RegisterInstancesWithLoadBalancerResponse (Prelude.Maybe [Instance])
registerInstancesWithLoadBalancerResponse_instances :: (Maybe [Instance] -> f (Maybe [Instance]))
-> RegisterInstancesWithLoadBalancerResponse
-> f RegisterInstancesWithLoadBalancerResponse
registerInstancesWithLoadBalancerResponse_instances = (RegisterInstancesWithLoadBalancerResponse -> Maybe [Instance])
-> (RegisterInstancesWithLoadBalancerResponse
    -> Maybe [Instance] -> RegisterInstancesWithLoadBalancerResponse)
-> Lens
     RegisterInstancesWithLoadBalancerResponse
     RegisterInstancesWithLoadBalancerResponse
     (Maybe [Instance])
     (Maybe [Instance])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterInstancesWithLoadBalancerResponse' {Maybe [Instance]
instances :: Maybe [Instance]
$sel:instances:RegisterInstancesWithLoadBalancerResponse' :: RegisterInstancesWithLoadBalancerResponse -> Maybe [Instance]
instances} -> Maybe [Instance]
instances) (\s :: RegisterInstancesWithLoadBalancerResponse
s@RegisterInstancesWithLoadBalancerResponse' {} Maybe [Instance]
a -> RegisterInstancesWithLoadBalancerResponse
s {$sel:instances:RegisterInstancesWithLoadBalancerResponse' :: Maybe [Instance]
instances = Maybe [Instance]
a} :: RegisterInstancesWithLoadBalancerResponse) ((Maybe [Instance] -> f (Maybe [Instance]))
 -> RegisterInstancesWithLoadBalancerResponse
 -> f RegisterInstancesWithLoadBalancerResponse)
-> ((Maybe [Instance] -> f (Maybe [Instance]))
    -> Maybe [Instance] -> f (Maybe [Instance]))
-> (Maybe [Instance] -> f (Maybe [Instance]))
-> RegisterInstancesWithLoadBalancerResponse
-> f RegisterInstancesWithLoadBalancerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Instance] [Instance] [Instance] [Instance]
-> Iso
     (Maybe [Instance])
     (Maybe [Instance])
     (Maybe [Instance])
     (Maybe [Instance])
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 [Instance] [Instance] [Instance] [Instance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    RegisterInstancesWithLoadBalancerResponse