{-# 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.EnableAvailabilityZonesForLoadBalancer
-- 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 Availability Zones to the set of Availability Zones
-- for the specified load balancer in EC2-Classic or a default VPC.
--
-- For load balancers in a non-default VPC, use
-- AttachLoadBalancerToSubnets.
--
-- The load balancer evenly distributes requests across all its registered
-- Availability Zones that contain instances. For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html Add or Remove Availability Zones>
-- in the /Classic Load Balancers Guide/.
module Amazonka.ELB.EnableAvailabilityZonesForLoadBalancer
  ( -- * Creating a Request
    EnableAvailabilityZonesForLoadBalancer (..),
    newEnableAvailabilityZonesForLoadBalancer,

    -- * Request Lenses
    enableAvailabilityZonesForLoadBalancer_loadBalancerName,
    enableAvailabilityZonesForLoadBalancer_availabilityZones,

    -- * Destructuring the Response
    EnableAvailabilityZonesForLoadBalancerResponse (..),
    newEnableAvailabilityZonesForLoadBalancerResponse,

    -- * Response Lenses
    enableAvailabilityZonesForLoadBalancerResponse_availabilityZones,
    enableAvailabilityZonesForLoadBalancerResponse_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 EnableAvailabilityZonesForLoadBalancer.
--
-- /See:/ 'newEnableAvailabilityZonesForLoadBalancer' smart constructor.
data EnableAvailabilityZonesForLoadBalancer = EnableAvailabilityZonesForLoadBalancer'
  { -- | The name of the load balancer.
    EnableAvailabilityZonesForLoadBalancer -> Text
loadBalancerName :: Prelude.Text,
    -- | The Availability Zones. These must be in the same region as the load
    -- balancer.
    EnableAvailabilityZonesForLoadBalancer -> [Text]
availabilityZones :: [Prelude.Text]
  }
  deriving (EnableAvailabilityZonesForLoadBalancer
-> EnableAvailabilityZonesForLoadBalancer -> Bool
(EnableAvailabilityZonesForLoadBalancer
 -> EnableAvailabilityZonesForLoadBalancer -> Bool)
-> (EnableAvailabilityZonesForLoadBalancer
    -> EnableAvailabilityZonesForLoadBalancer -> Bool)
-> Eq EnableAvailabilityZonesForLoadBalancer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableAvailabilityZonesForLoadBalancer
-> EnableAvailabilityZonesForLoadBalancer -> Bool
$c/= :: EnableAvailabilityZonesForLoadBalancer
-> EnableAvailabilityZonesForLoadBalancer -> Bool
== :: EnableAvailabilityZonesForLoadBalancer
-> EnableAvailabilityZonesForLoadBalancer -> Bool
$c== :: EnableAvailabilityZonesForLoadBalancer
-> EnableAvailabilityZonesForLoadBalancer -> Bool
Prelude.Eq, ReadPrec [EnableAvailabilityZonesForLoadBalancer]
ReadPrec EnableAvailabilityZonesForLoadBalancer
Int -> ReadS EnableAvailabilityZonesForLoadBalancer
ReadS [EnableAvailabilityZonesForLoadBalancer]
(Int -> ReadS EnableAvailabilityZonesForLoadBalancer)
-> ReadS [EnableAvailabilityZonesForLoadBalancer]
-> ReadPrec EnableAvailabilityZonesForLoadBalancer
-> ReadPrec [EnableAvailabilityZonesForLoadBalancer]
-> Read EnableAvailabilityZonesForLoadBalancer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableAvailabilityZonesForLoadBalancer]
$creadListPrec :: ReadPrec [EnableAvailabilityZonesForLoadBalancer]
readPrec :: ReadPrec EnableAvailabilityZonesForLoadBalancer
$creadPrec :: ReadPrec EnableAvailabilityZonesForLoadBalancer
readList :: ReadS [EnableAvailabilityZonesForLoadBalancer]
$creadList :: ReadS [EnableAvailabilityZonesForLoadBalancer]
readsPrec :: Int -> ReadS EnableAvailabilityZonesForLoadBalancer
$creadsPrec :: Int -> ReadS EnableAvailabilityZonesForLoadBalancer
Prelude.Read, Int -> EnableAvailabilityZonesForLoadBalancer -> ShowS
[EnableAvailabilityZonesForLoadBalancer] -> ShowS
EnableAvailabilityZonesForLoadBalancer -> String
(Int -> EnableAvailabilityZonesForLoadBalancer -> ShowS)
-> (EnableAvailabilityZonesForLoadBalancer -> String)
-> ([EnableAvailabilityZonesForLoadBalancer] -> ShowS)
-> Show EnableAvailabilityZonesForLoadBalancer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableAvailabilityZonesForLoadBalancer] -> ShowS
$cshowList :: [EnableAvailabilityZonesForLoadBalancer] -> ShowS
show :: EnableAvailabilityZonesForLoadBalancer -> String
$cshow :: EnableAvailabilityZonesForLoadBalancer -> String
showsPrec :: Int -> EnableAvailabilityZonesForLoadBalancer -> ShowS
$cshowsPrec :: Int -> EnableAvailabilityZonesForLoadBalancer -> ShowS
Prelude.Show, (forall x.
 EnableAvailabilityZonesForLoadBalancer
 -> Rep EnableAvailabilityZonesForLoadBalancer x)
-> (forall x.
    Rep EnableAvailabilityZonesForLoadBalancer x
    -> EnableAvailabilityZonesForLoadBalancer)
-> Generic EnableAvailabilityZonesForLoadBalancer
forall x.
Rep EnableAvailabilityZonesForLoadBalancer x
-> EnableAvailabilityZonesForLoadBalancer
forall x.
EnableAvailabilityZonesForLoadBalancer
-> Rep EnableAvailabilityZonesForLoadBalancer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableAvailabilityZonesForLoadBalancer x
-> EnableAvailabilityZonesForLoadBalancer
$cfrom :: forall x.
EnableAvailabilityZonesForLoadBalancer
-> Rep EnableAvailabilityZonesForLoadBalancer x
Prelude.Generic)

-- |
-- Create a value of 'EnableAvailabilityZonesForLoadBalancer' 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', 'enableAvailabilityZonesForLoadBalancer_loadBalancerName' - The name of the load balancer.
--
-- 'availabilityZones', 'enableAvailabilityZonesForLoadBalancer_availabilityZones' - The Availability Zones. These must be in the same region as the load
-- balancer.
newEnableAvailabilityZonesForLoadBalancer ::
  -- | 'loadBalancerName'
  Prelude.Text ->
  EnableAvailabilityZonesForLoadBalancer
newEnableAvailabilityZonesForLoadBalancer :: Text -> EnableAvailabilityZonesForLoadBalancer
newEnableAvailabilityZonesForLoadBalancer
  Text
pLoadBalancerName_ =
    EnableAvailabilityZonesForLoadBalancer' :: Text -> [Text] -> EnableAvailabilityZonesForLoadBalancer
EnableAvailabilityZonesForLoadBalancer'
      { $sel:loadBalancerName:EnableAvailabilityZonesForLoadBalancer' :: Text
loadBalancerName =
          Text
pLoadBalancerName_,
        $sel:availabilityZones:EnableAvailabilityZonesForLoadBalancer' :: [Text]
availabilityZones = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

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

-- | The Availability Zones. These must be in the same region as the load
-- balancer.
enableAvailabilityZonesForLoadBalancer_availabilityZones :: Lens.Lens' EnableAvailabilityZonesForLoadBalancer [Prelude.Text]
enableAvailabilityZonesForLoadBalancer_availabilityZones :: ([Text] -> f [Text])
-> EnableAvailabilityZonesForLoadBalancer
-> f EnableAvailabilityZonesForLoadBalancer
enableAvailabilityZonesForLoadBalancer_availabilityZones = (EnableAvailabilityZonesForLoadBalancer -> [Text])
-> (EnableAvailabilityZonesForLoadBalancer
    -> [Text] -> EnableAvailabilityZonesForLoadBalancer)
-> Lens
     EnableAvailabilityZonesForLoadBalancer
     EnableAvailabilityZonesForLoadBalancer
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableAvailabilityZonesForLoadBalancer' {[Text]
availabilityZones :: [Text]
$sel:availabilityZones:EnableAvailabilityZonesForLoadBalancer' :: EnableAvailabilityZonesForLoadBalancer -> [Text]
availabilityZones} -> [Text]
availabilityZones) (\s :: EnableAvailabilityZonesForLoadBalancer
s@EnableAvailabilityZonesForLoadBalancer' {} [Text]
a -> EnableAvailabilityZonesForLoadBalancer
s {$sel:availabilityZones:EnableAvailabilityZonesForLoadBalancer' :: [Text]
availabilityZones = [Text]
a} :: EnableAvailabilityZonesForLoadBalancer) (([Text] -> f [Text])
 -> EnableAvailabilityZonesForLoadBalancer
 -> f EnableAvailabilityZonesForLoadBalancer)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> EnableAvailabilityZonesForLoadBalancer
-> f EnableAvailabilityZonesForLoadBalancer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    EnableAvailabilityZonesForLoadBalancer

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

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

instance
  Core.ToQuery
    EnableAvailabilityZonesForLoadBalancer
  where
  toQuery :: EnableAvailabilityZonesForLoadBalancer -> QueryString
toQuery EnableAvailabilityZonesForLoadBalancer' {[Text]
Text
availabilityZones :: [Text]
loadBalancerName :: Text
$sel:availabilityZones:EnableAvailabilityZonesForLoadBalancer' :: EnableAvailabilityZonesForLoadBalancer -> [Text]
$sel:loadBalancerName:EnableAvailabilityZonesForLoadBalancer' :: EnableAvailabilityZonesForLoadBalancer -> 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
"EnableAvailabilityZonesForLoadBalancer" ::
                      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
"AvailabilityZones"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
availabilityZones
      ]

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

-- |
-- Create a value of 'EnableAvailabilityZonesForLoadBalancerResponse' 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:
--
-- 'availabilityZones', 'enableAvailabilityZonesForLoadBalancerResponse_availabilityZones' - The updated list of Availability Zones for the load balancer.
--
-- 'httpStatus', 'enableAvailabilityZonesForLoadBalancerResponse_httpStatus' - The response's http status code.
newEnableAvailabilityZonesForLoadBalancerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  EnableAvailabilityZonesForLoadBalancerResponse
newEnableAvailabilityZonesForLoadBalancerResponse :: Int -> EnableAvailabilityZonesForLoadBalancerResponse
newEnableAvailabilityZonesForLoadBalancerResponse
  Int
pHttpStatus_ =
    EnableAvailabilityZonesForLoadBalancerResponse' :: Maybe [Text]
-> Int -> EnableAvailabilityZonesForLoadBalancerResponse
EnableAvailabilityZonesForLoadBalancerResponse'
      { $sel:availabilityZones:EnableAvailabilityZonesForLoadBalancerResponse' :: Maybe [Text]
availabilityZones =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:EnableAvailabilityZonesForLoadBalancerResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

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

instance
  Prelude.NFData
    EnableAvailabilityZonesForLoadBalancerResponse