{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_ipAddressType,
    setSubnets_subnetMappings,
    setSubnets_subnets,
    setSubnets_loadBalancerArn,

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

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

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

-- | /See:/ 'newSetSubnets' smart constructor.
data SetSubnets = SetSubnets'
  { -- | [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.
    -- .
    SetSubnets -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
    -- | 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],
    -- | The Amazon Resource Name (ARN) of the load balancer.
    SetSubnets -> Text
loadBalancerArn :: Prelude.Text
  }
  deriving (SetSubnets -> SetSubnets -> Bool
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]
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
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. 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:
--
-- '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.
-- .
--
-- '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.
--
-- 'loadBalancerArn', 'setSubnets_loadBalancerArn' - The Amazon Resource Name (ARN) of the load balancer.
newSetSubnets ::
  -- | 'loadBalancerArn'
  Prelude.Text ->
  SetSubnets
newSetSubnets :: Text -> SetSubnets
newSetSubnets Text
pLoadBalancerArn_ =
  SetSubnets'
    { $sel:ipAddressType:SetSubnets' :: Maybe IpAddressType
ipAddressType = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetMappings:SetSubnets' :: Maybe [SubnetMapping]
subnetMappings = forall a. Maybe a
Prelude.Nothing,
      $sel:subnets:SetSubnets' :: Maybe [Text]
subnets = forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancerArn:SetSubnets' :: Text
loadBalancerArn = Text
pLoadBalancerArn_
    }

-- | [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.
-- .
setSubnets_ipAddressType :: Lens.Lens' SetSubnets (Prelude.Maybe IpAddressType)
setSubnets_ipAddressType :: Lens' SetSubnets (Maybe IpAddressType)
setSubnets_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 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 :: Lens' SetSubnets (Maybe [SubnetMapping])
setSubnets_subnetMappings = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: Lens' SetSubnets (Maybe [Text])
setSubnets_subnets = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the load balancer.
setSubnets_loadBalancerArn :: Lens.Lens' SetSubnets Prelude.Text
setSubnets_loadBalancerArn :: Lens' SetSubnets Text
setSubnets_loadBalancerArn = 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 :: (Service -> Service) -> SetSubnets -> Request SetSubnets
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SetSubnets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetSubnets)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"SetSubnetsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [AvailabilityZone]
-> Maybe IpAddressType -> Int -> SetSubnetsResponse
SetSubnetsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AvailabilityZones"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IpAddressType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable SetSubnets where
  hashWithSalt :: Int -> SetSubnets -> Int
hashWithSalt Int
_salt SetSubnets' {Maybe [Text]
Maybe [SubnetMapping]
Maybe IpAddressType
Text
loadBalancerArn :: Text
subnets :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
ipAddressType :: Maybe IpAddressType
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpAddressType
ipAddressType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SubnetMapping]
subnetMappings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subnets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
loadBalancerArn

instance Prelude.NFData SetSubnets where
  rnf :: SetSubnets -> ()
rnf SetSubnets' {Maybe [Text]
Maybe [SubnetMapping]
Maybe IpAddressType
Text
loadBalancerArn :: Text
subnets :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
ipAddressType :: Maybe IpAddressType
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe IpAddressType
ipAddressType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SubnetMapping]
subnetMappings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
loadBalancerArn

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

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

instance Data.ToQuery SetSubnets where
  toQuery :: SetSubnets -> QueryString
toQuery SetSubnets' {Maybe [Text]
Maybe [SubnetMapping]
Maybe IpAddressType
Text
loadBalancerArn :: Text
subnets :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
ipAddressType :: Maybe IpAddressType
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SetSubnets" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
        ByteString
"IpAddressType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe IpAddressType
ipAddressType,
        ByteString
"SubnetMappings"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SubnetMapping]
subnetMappings
            ),
        ByteString
"Subnets"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnets),
        ByteString
"LoadBalancerArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
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]
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
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. 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'
    { $sel:availabilityZones:SetSubnetsResponse' :: Maybe [AvailabilityZone]
availabilityZones =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:SetSubnetsResponse' :: Maybe IpAddressType
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 :: Lens' SetSubnetsResponse (Maybe [AvailabilityZone])
setSubnetsResponse_availabilityZones = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Network Load Balancers] The IP address type.
setSubnetsResponse_ipAddressType :: Lens.Lens' SetSubnetsResponse (Prelude.Maybe IpAddressType)
setSubnetsResponse_ipAddressType :: Lens' SetSubnetsResponse (Maybe IpAddressType)
setSubnetsResponse_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 :: Lens' SetSubnetsResponse Int
setSubnetsResponse_httpStatus = 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 where
  rnf :: SetSubnetsResponse -> ()
rnf SetSubnetsResponse' {Int
Maybe [AvailabilityZone]
Maybe IpAddressType
httpStatus :: Int
ipAddressType :: Maybe IpAddressType
availabilityZones :: Maybe [AvailabilityZone]
$sel:httpStatus:SetSubnetsResponse' :: SetSubnetsResponse -> Int
$sel:ipAddressType:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe IpAddressType
$sel:availabilityZones:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe [AvailabilityZone]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AvailabilityZone]
availabilityZones
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpAddressType
ipAddressType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus