{-# 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.SetSubnets
-- 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)
--
-- Enables the Availability Zones for the specified public subnets for the
-- specified Application Load Balancer or Network Load Balancer. The
-- specified subnets replace the previously enabled subnets.
--
-- When you specify subnets for a Network Load Balancer, you must include
-- all subnets that were enabled previously, with their existing
-- configurations, plus any additional subnets.
module Amazonka.ELBV2.SetSubnets
  ( -- * Creating a Request
    SetSubnets (..),
    newSetSubnets,

    -- * Request Lenses
    setSubnets_subnetMappings,
    setSubnets_subnets,
    setSubnets_ipAddressType,
    setSubnets_loadBalancerArn,

    -- * Destructuring the Response
    SetSubnetsResponse (..),
    newSetSubnetsResponse,

    -- * Response Lenses
    setSubnetsResponse_availabilityZones,
    setSubnetsResponse_ipAddressType,
    setSubnetsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newSetSubnets' smart constructor.
data SetSubnets = SetSubnets'
  { -- | The IDs of the public subnets. You can specify only one subnet per
    -- Availability Zone. You must specify either subnets or subnet mappings.
    --
    -- [Application Load Balancers] You must specify subnets from at least two
    -- Availability Zones. You cannot specify Elastic IP addresses for your
    -- subnets.
    --
    -- [Application Load Balancers on Outposts] You must specify one Outpost
    -- subnet.
    --
    -- [Application Load Balancers on Local Zones] You can specify subnets from
    -- one or more Local Zones.
    --
    -- [Network Load Balancers] You can specify subnets from one or more
    -- Availability Zones. You can specify one Elastic IP address per subnet if
    -- you need static IP addresses for your internet-facing load balancer. For
    -- internal load balancers, you can specify one private IP address per
    -- subnet from the IPv4 range of the subnet. For internet-facing load
    -- balancer, you can specify one IPv6 address per subnet.
    SetSubnets -> Maybe [SubnetMapping]
subnetMappings :: Prelude.Maybe [SubnetMapping],
    -- | The IDs of the public subnets. You can specify only one subnet per
    -- Availability Zone. You must specify either subnets or subnet mappings.
    --
    -- [Application Load Balancers] You must specify subnets from at least two
    -- Availability Zones.
    --
    -- [Application Load Balancers on Outposts] You must specify one Outpost
    -- subnet.
    --
    -- [Application Load Balancers on Local Zones] You can specify subnets from
    -- one or more Local Zones.
    --
    -- [Network Load Balancers] You can specify subnets from one or more
    -- Availability Zones.
    SetSubnets -> Maybe [Text]
subnets :: Prelude.Maybe [Prelude.Text],
    -- | [Network Load Balancers] The type of IP addresses used by the subnets
    -- for your load balancer. The possible values are @ipv4@ (for IPv4
    -- addresses) and @dualstack@ (for IPv4 and IPv6 addresses). You can’t
    -- specify @dualstack@ for a load balancer with a UDP or TCP_UDP listener.
    -- Internal load balancers must use @ipv4@.
    SetSubnets -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
    -- | The Amazon Resource Name (ARN) of the load balancer.
    SetSubnets -> Text
loadBalancerArn :: Prelude.Text
  }
  deriving (SetSubnets -> SetSubnets -> Bool
(SetSubnets -> SetSubnets -> Bool)
-> (SetSubnets -> SetSubnets -> Bool) -> Eq SetSubnets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetSubnets -> SetSubnets -> Bool
$c/= :: SetSubnets -> SetSubnets -> Bool
== :: SetSubnets -> SetSubnets -> Bool
$c== :: SetSubnets -> SetSubnets -> Bool
Prelude.Eq, ReadPrec [SetSubnets]
ReadPrec SetSubnets
Int -> ReadS SetSubnets
ReadS [SetSubnets]
(Int -> ReadS SetSubnets)
-> ReadS [SetSubnets]
-> ReadPrec SetSubnets
-> ReadPrec [SetSubnets]
-> Read SetSubnets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetSubnets]
$creadListPrec :: ReadPrec [SetSubnets]
readPrec :: ReadPrec SetSubnets
$creadPrec :: ReadPrec SetSubnets
readList :: ReadS [SetSubnets]
$creadList :: ReadS [SetSubnets]
readsPrec :: Int -> ReadS SetSubnets
$creadsPrec :: Int -> ReadS SetSubnets
Prelude.Read, Int -> SetSubnets -> ShowS
[SetSubnets] -> ShowS
SetSubnets -> String
(Int -> SetSubnets -> ShowS)
-> (SetSubnets -> String)
-> ([SetSubnets] -> ShowS)
-> Show SetSubnets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetSubnets] -> ShowS
$cshowList :: [SetSubnets] -> ShowS
show :: SetSubnets -> String
$cshow :: SetSubnets -> String
showsPrec :: Int -> SetSubnets -> ShowS
$cshowsPrec :: Int -> SetSubnets -> ShowS
Prelude.Show, (forall x. SetSubnets -> Rep SetSubnets x)
-> (forall x. Rep SetSubnets x -> SetSubnets) -> Generic SetSubnets
forall x. Rep SetSubnets x -> SetSubnets
forall x. SetSubnets -> Rep SetSubnets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetSubnets x -> SetSubnets
$cfrom :: forall x. SetSubnets -> Rep SetSubnets x
Prelude.Generic)

-- |
-- Create a value of 'SetSubnets' 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:
--
-- 'subnetMappings', 'setSubnets_subnetMappings' - The IDs of the public subnets. You can specify only one subnet per
-- Availability Zone. You must specify either subnets or subnet mappings.
--
-- [Application Load Balancers] You must specify subnets from at least two
-- Availability Zones. You cannot specify Elastic IP addresses for your
-- subnets.
--
-- [Application Load Balancers on Outposts] You must specify one Outpost
-- subnet.
--
-- [Application Load Balancers on Local Zones] You can specify subnets from
-- one or more Local Zones.
--
-- [Network Load Balancers] You can specify subnets from one or more
-- Availability Zones. You can specify one Elastic IP address per subnet if
-- you need static IP addresses for your internet-facing load balancer. For
-- internal load balancers, you can specify one private IP address per
-- subnet from the IPv4 range of the subnet. For internet-facing load
-- balancer, you can specify one IPv6 address per subnet.
--
-- 'subnets', 'setSubnets_subnets' - The IDs of the public subnets. You can specify only one subnet per
-- Availability Zone. You must specify either subnets or subnet mappings.
--
-- [Application Load Balancers] You must specify subnets from at least two
-- Availability Zones.
--
-- [Application Load Balancers on Outposts] You must specify one Outpost
-- subnet.
--
-- [Application Load Balancers on Local Zones] You can specify subnets from
-- one or more Local Zones.
--
-- [Network Load Balancers] You can specify subnets from one or more
-- Availability Zones.
--
-- 'ipAddressType', 'setSubnets_ipAddressType' - [Network Load Balancers] The type of IP addresses used by the subnets
-- for your load balancer. The possible values are @ipv4@ (for IPv4
-- addresses) and @dualstack@ (for IPv4 and IPv6 addresses). You can’t
-- specify @dualstack@ for a load balancer with a UDP or TCP_UDP listener.
-- Internal load balancers must use @ipv4@.
--
-- 'loadBalancerArn', 'setSubnets_loadBalancerArn' - The Amazon Resource Name (ARN) of the load balancer.
newSetSubnets ::
  -- | 'loadBalancerArn'
  Prelude.Text ->
  SetSubnets
newSetSubnets :: Text -> SetSubnets
newSetSubnets Text
pLoadBalancerArn_ =
  SetSubnets' :: Maybe [SubnetMapping]
-> Maybe [Text] -> Maybe IpAddressType -> Text -> SetSubnets
SetSubnets'
    { $sel:subnetMappings:SetSubnets' :: Maybe [SubnetMapping]
subnetMappings = Maybe [SubnetMapping]
forall a. Maybe a
Prelude.Nothing,
      $sel:subnets:SetSubnets' :: Maybe [Text]
subnets = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:SetSubnets' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancerArn:SetSubnets' :: Text
loadBalancerArn = Text
pLoadBalancerArn_
    }

-- | The IDs of the public subnets. You can specify only one subnet per
-- Availability Zone. You must specify either subnets or subnet mappings.
--
-- [Application Load Balancers] You must specify subnets from at least two
-- Availability Zones. You cannot specify Elastic IP addresses for your
-- subnets.
--
-- [Application Load Balancers on Outposts] You must specify one Outpost
-- subnet.
--
-- [Application Load Balancers on Local Zones] You can specify subnets from
-- one or more Local Zones.
--
-- [Network Load Balancers] You can specify subnets from one or more
-- Availability Zones. You can specify one Elastic IP address per subnet if
-- you need static IP addresses for your internet-facing load balancer. For
-- internal load balancers, you can specify one private IP address per
-- subnet from the IPv4 range of the subnet. For internet-facing load
-- balancer, you can specify one IPv6 address per subnet.
setSubnets_subnetMappings :: Lens.Lens' SetSubnets (Prelude.Maybe [SubnetMapping])
setSubnets_subnetMappings :: (Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> SetSubnets -> f SetSubnets
setSubnets_subnetMappings = (SetSubnets -> Maybe [SubnetMapping])
-> (SetSubnets -> Maybe [SubnetMapping] -> SetSubnets)
-> Lens
     SetSubnets
     SetSubnets
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Maybe [SubnetMapping]
subnetMappings :: Maybe [SubnetMapping]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
subnetMappings} -> Maybe [SubnetMapping]
subnetMappings) (\s :: SetSubnets
s@SetSubnets' {} Maybe [SubnetMapping]
a -> SetSubnets
s {$sel:subnetMappings:SetSubnets' :: Maybe [SubnetMapping]
subnetMappings = Maybe [SubnetMapping]
a} :: SetSubnets) ((Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
 -> SetSubnets -> f SetSubnets)
-> ((Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
    -> Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> (Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> SetSubnets
-> f SetSubnets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SubnetMapping] [SubnetMapping] [SubnetMapping] [SubnetMapping]
-> Iso
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
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
  [SubnetMapping] [SubnetMapping] [SubnetMapping] [SubnetMapping]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IDs of the public subnets. You can specify only one subnet per
-- Availability Zone. You must specify either subnets or subnet mappings.
--
-- [Application Load Balancers] You must specify subnets from at least two
-- Availability Zones.
--
-- [Application Load Balancers on Outposts] You must specify one Outpost
-- subnet.
--
-- [Application Load Balancers on Local Zones] You can specify subnets from
-- one or more Local Zones.
--
-- [Network Load Balancers] You can specify subnets from one or more
-- Availability Zones.
setSubnets_subnets :: Lens.Lens' SetSubnets (Prelude.Maybe [Prelude.Text])
setSubnets_subnets :: (Maybe [Text] -> f (Maybe [Text])) -> SetSubnets -> f SetSubnets
setSubnets_subnets = (SetSubnets -> Maybe [Text])
-> (SetSubnets -> Maybe [Text] -> SetSubnets)
-> Lens SetSubnets SetSubnets (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Maybe [Text]
subnets :: Maybe [Text]
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
subnets} -> Maybe [Text]
subnets) (\s :: SetSubnets
s@SetSubnets' {} Maybe [Text]
a -> SetSubnets
s {$sel:subnets:SetSubnets' :: Maybe [Text]
subnets = Maybe [Text]
a} :: SetSubnets) ((Maybe [Text] -> f (Maybe [Text])) -> SetSubnets -> f SetSubnets)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SetSubnets
-> f SetSubnets
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

-- | [Network Load Balancers] The type of IP addresses used by the subnets
-- for your load balancer. The possible values are @ipv4@ (for IPv4
-- addresses) and @dualstack@ (for IPv4 and IPv6 addresses). You can’t
-- specify @dualstack@ for a load balancer with a UDP or TCP_UDP listener.
-- Internal load balancers must use @ipv4@.
setSubnets_ipAddressType :: Lens.Lens' SetSubnets (Prelude.Maybe IpAddressType)
setSubnets_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> SetSubnets -> f SetSubnets
setSubnets_ipAddressType = (SetSubnets -> Maybe IpAddressType)
-> (SetSubnets -> Maybe IpAddressType -> SetSubnets)
-> Lens
     SetSubnets SetSubnets (Maybe IpAddressType) (Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: SetSubnets
s@SetSubnets' {} Maybe IpAddressType
a -> SetSubnets
s {$sel:ipAddressType:SetSubnets' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: SetSubnets)

-- | The Amazon Resource Name (ARN) of the load balancer.
setSubnets_loadBalancerArn :: Lens.Lens' SetSubnets Prelude.Text
setSubnets_loadBalancerArn :: (Text -> f Text) -> SetSubnets -> f SetSubnets
setSubnets_loadBalancerArn = (SetSubnets -> Text)
-> (SetSubnets -> Text -> SetSubnets)
-> Lens SetSubnets SetSubnets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Text
loadBalancerArn :: Text
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
loadBalancerArn} -> Text
loadBalancerArn) (\s :: SetSubnets
s@SetSubnets' {} Text
a -> SetSubnets
s {$sel:loadBalancerArn:SetSubnets' :: Text
loadBalancerArn = Text
a} :: SetSubnets)

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

instance Prelude.NFData SetSubnets

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

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

instance Core.ToQuery SetSubnets where
  toQuery :: SetSubnets -> QueryString
toQuery SetSubnets' {Maybe [Text]
Maybe [SubnetMapping]
Maybe IpAddressType
Text
loadBalancerArn :: Text
ipAddressType :: Maybe IpAddressType
subnets :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SetSubnets" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
        ByteString
"SubnetMappings"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [SubnetMapping] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([SubnetMapping] -> QueryString)
-> Maybe [SubnetMapping] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SubnetMapping]
subnetMappings
            ),
        ByteString
"Subnets"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnets),
        ByteString
"IpAddressType" ByteString -> Maybe IpAddressType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe IpAddressType
ipAddressType,
        ByteString
"LoadBalancerArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
loadBalancerArn
      ]

-- | /See:/ 'newSetSubnetsResponse' smart constructor.
data SetSubnetsResponse = SetSubnetsResponse'
  { -- | Information about the subnets.
    SetSubnetsResponse -> Maybe [AvailabilityZone]
availabilityZones :: Prelude.Maybe [AvailabilityZone],
    -- | [Network Load Balancers] The IP address type.
    SetSubnetsResponse -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
    -- | The response's http status code.
    SetSubnetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SetSubnetsResponse -> SetSubnetsResponse -> Bool
(SetSubnetsResponse -> SetSubnetsResponse -> Bool)
-> (SetSubnetsResponse -> SetSubnetsResponse -> Bool)
-> Eq SetSubnetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
$c/= :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
== :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
$c== :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
Prelude.Eq, ReadPrec [SetSubnetsResponse]
ReadPrec SetSubnetsResponse
Int -> ReadS SetSubnetsResponse
ReadS [SetSubnetsResponse]
(Int -> ReadS SetSubnetsResponse)
-> ReadS [SetSubnetsResponse]
-> ReadPrec SetSubnetsResponse
-> ReadPrec [SetSubnetsResponse]
-> Read SetSubnetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetSubnetsResponse]
$creadListPrec :: ReadPrec [SetSubnetsResponse]
readPrec :: ReadPrec SetSubnetsResponse
$creadPrec :: ReadPrec SetSubnetsResponse
readList :: ReadS [SetSubnetsResponse]
$creadList :: ReadS [SetSubnetsResponse]
readsPrec :: Int -> ReadS SetSubnetsResponse
$creadsPrec :: Int -> ReadS SetSubnetsResponse
Prelude.Read, Int -> SetSubnetsResponse -> ShowS
[SetSubnetsResponse] -> ShowS
SetSubnetsResponse -> String
(Int -> SetSubnetsResponse -> ShowS)
-> (SetSubnetsResponse -> String)
-> ([SetSubnetsResponse] -> ShowS)
-> Show SetSubnetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetSubnetsResponse] -> ShowS
$cshowList :: [SetSubnetsResponse] -> ShowS
show :: SetSubnetsResponse -> String
$cshow :: SetSubnetsResponse -> String
showsPrec :: Int -> SetSubnetsResponse -> ShowS
$cshowsPrec :: Int -> SetSubnetsResponse -> ShowS
Prelude.Show, (forall x. SetSubnetsResponse -> Rep SetSubnetsResponse x)
-> (forall x. Rep SetSubnetsResponse x -> SetSubnetsResponse)
-> Generic SetSubnetsResponse
forall x. Rep SetSubnetsResponse x -> SetSubnetsResponse
forall x. SetSubnetsResponse -> Rep SetSubnetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetSubnetsResponse x -> SetSubnetsResponse
$cfrom :: forall x. SetSubnetsResponse -> Rep SetSubnetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'SetSubnetsResponse' 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', 'setSubnetsResponse_availabilityZones' - Information about the subnets.
--
-- 'ipAddressType', 'setSubnetsResponse_ipAddressType' - [Network Load Balancers] The IP address type.
--
-- 'httpStatus', 'setSubnetsResponse_httpStatus' - The response's http status code.
newSetSubnetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SetSubnetsResponse
newSetSubnetsResponse :: Int -> SetSubnetsResponse
newSetSubnetsResponse Int
pHttpStatus_ =
  SetSubnetsResponse' :: Maybe [AvailabilityZone]
-> Maybe IpAddressType -> Int -> SetSubnetsResponse
SetSubnetsResponse'
    { $sel:availabilityZones:SetSubnetsResponse' :: Maybe [AvailabilityZone]
availabilityZones =
        Maybe [AvailabilityZone]
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:SetSubnetsResponse' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SetSubnetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the subnets.
setSubnetsResponse_availabilityZones :: Lens.Lens' SetSubnetsResponse (Prelude.Maybe [AvailabilityZone])
setSubnetsResponse_availabilityZones :: (Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
-> SetSubnetsResponse -> f SetSubnetsResponse
setSubnetsResponse_availabilityZones = (SetSubnetsResponse -> Maybe [AvailabilityZone])
-> (SetSubnetsResponse
    -> Maybe [AvailabilityZone] -> SetSubnetsResponse)
-> Lens
     SetSubnetsResponse
     SetSubnetsResponse
     (Maybe [AvailabilityZone])
     (Maybe [AvailabilityZone])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnetsResponse' {Maybe [AvailabilityZone]
availabilityZones :: Maybe [AvailabilityZone]
$sel:availabilityZones:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe [AvailabilityZone]
availabilityZones} -> Maybe [AvailabilityZone]
availabilityZones) (\s :: SetSubnetsResponse
s@SetSubnetsResponse' {} Maybe [AvailabilityZone]
a -> SetSubnetsResponse
s {$sel:availabilityZones:SetSubnetsResponse' :: Maybe [AvailabilityZone]
availabilityZones = Maybe [AvailabilityZone]
a} :: SetSubnetsResponse) ((Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
 -> SetSubnetsResponse -> f SetSubnetsResponse)
-> ((Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
    -> Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
-> (Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
-> SetSubnetsResponse
-> f SetSubnetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AvailabilityZone]
  [AvailabilityZone]
  [AvailabilityZone]
  [AvailabilityZone]
-> Iso
     (Maybe [AvailabilityZone])
     (Maybe [AvailabilityZone])
     (Maybe [AvailabilityZone])
     (Maybe [AvailabilityZone])
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
  [AvailabilityZone]
  [AvailabilityZone]
  [AvailabilityZone]
  [AvailabilityZone]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Network Load Balancers] The IP address type.
setSubnetsResponse_ipAddressType :: Lens.Lens' SetSubnetsResponse (Prelude.Maybe IpAddressType)
setSubnetsResponse_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> SetSubnetsResponse -> f SetSubnetsResponse
setSubnetsResponse_ipAddressType = (SetSubnetsResponse -> Maybe IpAddressType)
-> (SetSubnetsResponse
    -> Maybe IpAddressType -> SetSubnetsResponse)
-> Lens
     SetSubnetsResponse
     SetSubnetsResponse
     (Maybe IpAddressType)
     (Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnetsResponse' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: SetSubnetsResponse
s@SetSubnetsResponse' {} Maybe IpAddressType
a -> SetSubnetsResponse
s {$sel:ipAddressType:SetSubnetsResponse' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: SetSubnetsResponse)

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

instance Prelude.NFData SetSubnetsResponse