{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.LoadBalancer
-- 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)
module Amazonka.ELBV2.Types.LoadBalancer where

import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types.AvailabilityZone
import Amazonka.ELBV2.Types.IpAddressType
import Amazonka.ELBV2.Types.LoadBalancerSchemeEnum
import Amazonka.ELBV2.Types.LoadBalancerState
import Amazonka.ELBV2.Types.LoadBalancerTypeEnum
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a load balancer.
--
-- /See:/ 'newLoadBalancer' smart constructor.
data LoadBalancer = LoadBalancer'
  { -- | The state of the load balancer.
    LoadBalancer -> Maybe LoadBalancerState
state :: Prelude.Maybe LoadBalancerState,
    -- | The IDs of the security groups for the load balancer.
    LoadBalancer -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The name of the load balancer.
    LoadBalancer -> Maybe Text
loadBalancerName :: Prelude.Maybe Prelude.Text,
    -- | The date and time the load balancer was created.
    LoadBalancer -> Maybe ISO8601
createdTime :: Prelude.Maybe Core.ISO8601,
    -- | The ID of the VPC for the load balancer.
    LoadBalancer -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Route 53 hosted zone associated with the load
    -- balancer.
    LoadBalancer -> Maybe Text
canonicalHostedZoneId :: Prelude.Maybe Prelude.Text,
    -- | The subnets for the load balancer.
    LoadBalancer -> Maybe [AvailabilityZone]
availabilityZones :: Prelude.Maybe [AvailabilityZone],
    -- | [Application Load Balancers on Outposts] The ID of the customer-owned
    -- address pool.
    LoadBalancer -> Maybe Text
customerOwnedIpv4Pool :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the load balancer.
    LoadBalancer -> Maybe Text
loadBalancerArn :: Prelude.Maybe Prelude.Text,
    -- | 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).
    LoadBalancer -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
    -- | The nodes of an Internet-facing load balancer have public IP addresses.
    -- The DNS name of an Internet-facing load balancer is publicly resolvable
    -- to the public IP addresses of the nodes. Therefore, Internet-facing load
    -- balancers can route requests from clients over the internet.
    --
    -- The nodes of an internal load balancer have only private IP addresses.
    -- The DNS name of an internal load balancer is publicly resolvable to the
    -- private IP addresses of the nodes. Therefore, internal load balancers
    -- can route requests only from clients with access to the VPC for the load
    -- balancer.
    LoadBalancer -> Maybe LoadBalancerSchemeEnum
scheme :: Prelude.Maybe LoadBalancerSchemeEnum,
    -- | The type of load balancer.
    LoadBalancer -> Maybe LoadBalancerTypeEnum
type' :: Prelude.Maybe LoadBalancerTypeEnum,
    -- | The public DNS name of the load balancer.
    LoadBalancer -> Maybe Text
dNSName :: Prelude.Maybe Prelude.Text
  }
  deriving (LoadBalancer -> LoadBalancer -> Bool
(LoadBalancer -> LoadBalancer -> Bool)
-> (LoadBalancer -> LoadBalancer -> Bool) -> Eq LoadBalancer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoadBalancer -> LoadBalancer -> Bool
$c/= :: LoadBalancer -> LoadBalancer -> Bool
== :: LoadBalancer -> LoadBalancer -> Bool
$c== :: LoadBalancer -> LoadBalancer -> Bool
Prelude.Eq, ReadPrec [LoadBalancer]
ReadPrec LoadBalancer
Int -> ReadS LoadBalancer
ReadS [LoadBalancer]
(Int -> ReadS LoadBalancer)
-> ReadS [LoadBalancer]
-> ReadPrec LoadBalancer
-> ReadPrec [LoadBalancer]
-> Read LoadBalancer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoadBalancer]
$creadListPrec :: ReadPrec [LoadBalancer]
readPrec :: ReadPrec LoadBalancer
$creadPrec :: ReadPrec LoadBalancer
readList :: ReadS [LoadBalancer]
$creadList :: ReadS [LoadBalancer]
readsPrec :: Int -> ReadS LoadBalancer
$creadsPrec :: Int -> ReadS LoadBalancer
Prelude.Read, Int -> LoadBalancer -> ShowS
[LoadBalancer] -> ShowS
LoadBalancer -> String
(Int -> LoadBalancer -> ShowS)
-> (LoadBalancer -> String)
-> ([LoadBalancer] -> ShowS)
-> Show LoadBalancer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoadBalancer] -> ShowS
$cshowList :: [LoadBalancer] -> ShowS
show :: LoadBalancer -> String
$cshow :: LoadBalancer -> String
showsPrec :: Int -> LoadBalancer -> ShowS
$cshowsPrec :: Int -> LoadBalancer -> ShowS
Prelude.Show, (forall x. LoadBalancer -> Rep LoadBalancer x)
-> (forall x. Rep LoadBalancer x -> LoadBalancer)
-> Generic LoadBalancer
forall x. Rep LoadBalancer x -> LoadBalancer
forall x. LoadBalancer -> Rep LoadBalancer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoadBalancer x -> LoadBalancer
$cfrom :: forall x. LoadBalancer -> Rep LoadBalancer x
Prelude.Generic)

-- |
-- Create a value of 'LoadBalancer' 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:
--
-- 'state', 'loadBalancer_state' - The state of the load balancer.
--
-- 'securityGroups', 'loadBalancer_securityGroups' - The IDs of the security groups for the load balancer.
--
-- 'loadBalancerName', 'loadBalancer_loadBalancerName' - The name of the load balancer.
--
-- 'createdTime', 'loadBalancer_createdTime' - The date and time the load balancer was created.
--
-- 'vpcId', 'loadBalancer_vpcId' - The ID of the VPC for the load balancer.
--
-- 'canonicalHostedZoneId', 'loadBalancer_canonicalHostedZoneId' - The ID of the Amazon Route 53 hosted zone associated with the load
-- balancer.
--
-- 'availabilityZones', 'loadBalancer_availabilityZones' - The subnets for the load balancer.
--
-- 'customerOwnedIpv4Pool', 'loadBalancer_customerOwnedIpv4Pool' - [Application Load Balancers on Outposts] The ID of the customer-owned
-- address pool.
--
-- 'loadBalancerArn', 'loadBalancer_loadBalancerArn' - The Amazon Resource Name (ARN) of the load balancer.
--
-- 'ipAddressType', 'loadBalancer_ipAddressType' - 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).
--
-- 'scheme', 'loadBalancer_scheme' - The nodes of an Internet-facing load balancer have public IP addresses.
-- The DNS name of an Internet-facing load balancer is publicly resolvable
-- to the public IP addresses of the nodes. Therefore, Internet-facing load
-- balancers can route requests from clients over the internet.
--
-- The nodes of an internal load balancer have only private IP addresses.
-- The DNS name of an internal load balancer is publicly resolvable to the
-- private IP addresses of the nodes. Therefore, internal load balancers
-- can route requests only from clients with access to the VPC for the load
-- balancer.
--
-- 'type'', 'loadBalancer_type' - The type of load balancer.
--
-- 'dNSName', 'loadBalancer_dNSName' - The public DNS name of the load balancer.
newLoadBalancer ::
  LoadBalancer
newLoadBalancer :: LoadBalancer
newLoadBalancer =
  LoadBalancer' :: Maybe LoadBalancerState
-> Maybe [Text]
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe [AvailabilityZone]
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressType
-> Maybe LoadBalancerSchemeEnum
-> Maybe LoadBalancerTypeEnum
-> Maybe Text
-> LoadBalancer
LoadBalancer'
    { $sel:state:LoadBalancer' :: Maybe LoadBalancerState
state = Maybe LoadBalancerState
forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroups:LoadBalancer' :: Maybe [Text]
securityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancerName:LoadBalancer' :: Maybe Text
loadBalancerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:LoadBalancer' :: Maybe ISO8601
createdTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:LoadBalancer' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:canonicalHostedZoneId:LoadBalancer' :: Maybe Text
canonicalHostedZoneId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZones:LoadBalancer' :: Maybe [AvailabilityZone]
availabilityZones = Maybe [AvailabilityZone]
forall a. Maybe a
Prelude.Nothing,
      $sel:customerOwnedIpv4Pool:LoadBalancer' :: Maybe Text
customerOwnedIpv4Pool = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancerArn:LoadBalancer' :: Maybe Text
loadBalancerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:LoadBalancer' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
      $sel:scheme:LoadBalancer' :: Maybe LoadBalancerSchemeEnum
scheme = Maybe LoadBalancerSchemeEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:type':LoadBalancer' :: Maybe LoadBalancerTypeEnum
type' = Maybe LoadBalancerTypeEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:dNSName:LoadBalancer' :: Maybe Text
dNSName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The state of the load balancer.
loadBalancer_state :: Lens.Lens' LoadBalancer (Prelude.Maybe LoadBalancerState)
loadBalancer_state :: (Maybe LoadBalancerState -> f (Maybe LoadBalancerState))
-> LoadBalancer -> f LoadBalancer
loadBalancer_state = (LoadBalancer -> Maybe LoadBalancerState)
-> (LoadBalancer -> Maybe LoadBalancerState -> LoadBalancer)
-> Lens
     LoadBalancer
     LoadBalancer
     (Maybe LoadBalancerState)
     (Maybe LoadBalancerState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe LoadBalancerState
state :: Maybe LoadBalancerState
$sel:state:LoadBalancer' :: LoadBalancer -> Maybe LoadBalancerState
state} -> Maybe LoadBalancerState
state) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe LoadBalancerState
a -> LoadBalancer
s {$sel:state:LoadBalancer' :: Maybe LoadBalancerState
state = Maybe LoadBalancerState
a} :: LoadBalancer)

-- | The IDs of the security groups for the load balancer.
loadBalancer_securityGroups :: Lens.Lens' LoadBalancer (Prelude.Maybe [Prelude.Text])
loadBalancer_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> LoadBalancer -> f LoadBalancer
loadBalancer_securityGroups = (LoadBalancer -> Maybe [Text])
-> (LoadBalancer -> Maybe [Text] -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:LoadBalancer' :: LoadBalancer -> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe [Text]
a -> LoadBalancer
s {$sel:securityGroups:LoadBalancer' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: LoadBalancer) ((Maybe [Text] -> f (Maybe [Text]))
 -> LoadBalancer -> f LoadBalancer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> LoadBalancer
-> f LoadBalancer
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 name of the load balancer.
loadBalancer_loadBalancerName :: Lens.Lens' LoadBalancer (Prelude.Maybe Prelude.Text)
loadBalancer_loadBalancerName :: (Maybe Text -> f (Maybe Text)) -> LoadBalancer -> f LoadBalancer
loadBalancer_loadBalancerName = (LoadBalancer -> Maybe Text)
-> (LoadBalancer -> Maybe Text -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe Text
loadBalancerName :: Maybe Text
$sel:loadBalancerName:LoadBalancer' :: LoadBalancer -> Maybe Text
loadBalancerName} -> Maybe Text
loadBalancerName) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe Text
a -> LoadBalancer
s {$sel:loadBalancerName:LoadBalancer' :: Maybe Text
loadBalancerName = Maybe Text
a} :: LoadBalancer)

-- | The date and time the load balancer was created.
loadBalancer_createdTime :: Lens.Lens' LoadBalancer (Prelude.Maybe Prelude.UTCTime)
loadBalancer_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LoadBalancer -> f LoadBalancer
loadBalancer_createdTime = (LoadBalancer -> Maybe ISO8601)
-> (LoadBalancer -> Maybe ISO8601 -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe ISO8601
createdTime :: Maybe ISO8601
$sel:createdTime:LoadBalancer' :: LoadBalancer -> Maybe ISO8601
createdTime} -> Maybe ISO8601
createdTime) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe ISO8601
a -> LoadBalancer
s {$sel:createdTime:LoadBalancer' :: Maybe ISO8601
createdTime = Maybe ISO8601
a} :: LoadBalancer) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> LoadBalancer -> f LoadBalancer)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LoadBalancer
-> f LoadBalancer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the VPC for the load balancer.
loadBalancer_vpcId :: Lens.Lens' LoadBalancer (Prelude.Maybe Prelude.Text)
loadBalancer_vpcId :: (Maybe Text -> f (Maybe Text)) -> LoadBalancer -> f LoadBalancer
loadBalancer_vpcId = (LoadBalancer -> Maybe Text)
-> (LoadBalancer -> Maybe Text -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:LoadBalancer' :: LoadBalancer -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe Text
a -> LoadBalancer
s {$sel:vpcId:LoadBalancer' :: Maybe Text
vpcId = Maybe Text
a} :: LoadBalancer)

-- | The ID of the Amazon Route 53 hosted zone associated with the load
-- balancer.
loadBalancer_canonicalHostedZoneId :: Lens.Lens' LoadBalancer (Prelude.Maybe Prelude.Text)
loadBalancer_canonicalHostedZoneId :: (Maybe Text -> f (Maybe Text)) -> LoadBalancer -> f LoadBalancer
loadBalancer_canonicalHostedZoneId = (LoadBalancer -> Maybe Text)
-> (LoadBalancer -> Maybe Text -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe Text
canonicalHostedZoneId :: Maybe Text
$sel:canonicalHostedZoneId:LoadBalancer' :: LoadBalancer -> Maybe Text
canonicalHostedZoneId} -> Maybe Text
canonicalHostedZoneId) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe Text
a -> LoadBalancer
s {$sel:canonicalHostedZoneId:LoadBalancer' :: Maybe Text
canonicalHostedZoneId = Maybe Text
a} :: LoadBalancer)

-- | The subnets for the load balancer.
loadBalancer_availabilityZones :: Lens.Lens' LoadBalancer (Prelude.Maybe [AvailabilityZone])
loadBalancer_availabilityZones :: (Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
-> LoadBalancer -> f LoadBalancer
loadBalancer_availabilityZones = (LoadBalancer -> Maybe [AvailabilityZone])
-> (LoadBalancer -> Maybe [AvailabilityZone] -> LoadBalancer)
-> Lens
     LoadBalancer
     LoadBalancer
     (Maybe [AvailabilityZone])
     (Maybe [AvailabilityZone])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe [AvailabilityZone]
availabilityZones :: Maybe [AvailabilityZone]
$sel:availabilityZones:LoadBalancer' :: LoadBalancer -> Maybe [AvailabilityZone]
availabilityZones} -> Maybe [AvailabilityZone]
availabilityZones) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe [AvailabilityZone]
a -> LoadBalancer
s {$sel:availabilityZones:LoadBalancer' :: Maybe [AvailabilityZone]
availabilityZones = Maybe [AvailabilityZone]
a} :: LoadBalancer) ((Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
 -> LoadBalancer -> f LoadBalancer)
-> ((Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
    -> Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
-> (Maybe [AvailabilityZone] -> f (Maybe [AvailabilityZone]))
-> LoadBalancer
-> f LoadBalancer
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

-- | [Application Load Balancers on Outposts] The ID of the customer-owned
-- address pool.
loadBalancer_customerOwnedIpv4Pool :: Lens.Lens' LoadBalancer (Prelude.Maybe Prelude.Text)
loadBalancer_customerOwnedIpv4Pool :: (Maybe Text -> f (Maybe Text)) -> LoadBalancer -> f LoadBalancer
loadBalancer_customerOwnedIpv4Pool = (LoadBalancer -> Maybe Text)
-> (LoadBalancer -> Maybe Text -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe Text
customerOwnedIpv4Pool :: Maybe Text
$sel:customerOwnedIpv4Pool:LoadBalancer' :: LoadBalancer -> Maybe Text
customerOwnedIpv4Pool} -> Maybe Text
customerOwnedIpv4Pool) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe Text
a -> LoadBalancer
s {$sel:customerOwnedIpv4Pool:LoadBalancer' :: Maybe Text
customerOwnedIpv4Pool = Maybe Text
a} :: LoadBalancer)

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

-- | 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).
loadBalancer_ipAddressType :: Lens.Lens' LoadBalancer (Prelude.Maybe IpAddressType)
loadBalancer_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> LoadBalancer -> f LoadBalancer
loadBalancer_ipAddressType = (LoadBalancer -> Maybe IpAddressType)
-> (LoadBalancer -> Maybe IpAddressType -> LoadBalancer)
-> Lens
     LoadBalancer
     LoadBalancer
     (Maybe IpAddressType)
     (Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:LoadBalancer' :: LoadBalancer -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe IpAddressType
a -> LoadBalancer
s {$sel:ipAddressType:LoadBalancer' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: LoadBalancer)

-- | The nodes of an Internet-facing load balancer have public IP addresses.
-- The DNS name of an Internet-facing load balancer is publicly resolvable
-- to the public IP addresses of the nodes. Therefore, Internet-facing load
-- balancers can route requests from clients over the internet.
--
-- The nodes of an internal load balancer have only private IP addresses.
-- The DNS name of an internal load balancer is publicly resolvable to the
-- private IP addresses of the nodes. Therefore, internal load balancers
-- can route requests only from clients with access to the VPC for the load
-- balancer.
loadBalancer_scheme :: Lens.Lens' LoadBalancer (Prelude.Maybe LoadBalancerSchemeEnum)
loadBalancer_scheme :: (Maybe LoadBalancerSchemeEnum -> f (Maybe LoadBalancerSchemeEnum))
-> LoadBalancer -> f LoadBalancer
loadBalancer_scheme = (LoadBalancer -> Maybe LoadBalancerSchemeEnum)
-> (LoadBalancer -> Maybe LoadBalancerSchemeEnum -> LoadBalancer)
-> Lens
     LoadBalancer
     LoadBalancer
     (Maybe LoadBalancerSchemeEnum)
     (Maybe LoadBalancerSchemeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe LoadBalancerSchemeEnum
scheme :: Maybe LoadBalancerSchemeEnum
$sel:scheme:LoadBalancer' :: LoadBalancer -> Maybe LoadBalancerSchemeEnum
scheme} -> Maybe LoadBalancerSchemeEnum
scheme) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe LoadBalancerSchemeEnum
a -> LoadBalancer
s {$sel:scheme:LoadBalancer' :: Maybe LoadBalancerSchemeEnum
scheme = Maybe LoadBalancerSchemeEnum
a} :: LoadBalancer)

-- | The type of load balancer.
loadBalancer_type :: Lens.Lens' LoadBalancer (Prelude.Maybe LoadBalancerTypeEnum)
loadBalancer_type :: (Maybe LoadBalancerTypeEnum -> f (Maybe LoadBalancerTypeEnum))
-> LoadBalancer -> f LoadBalancer
loadBalancer_type = (LoadBalancer -> Maybe LoadBalancerTypeEnum)
-> (LoadBalancer -> Maybe LoadBalancerTypeEnum -> LoadBalancer)
-> Lens
     LoadBalancer
     LoadBalancer
     (Maybe LoadBalancerTypeEnum)
     (Maybe LoadBalancerTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe LoadBalancerTypeEnum
type' :: Maybe LoadBalancerTypeEnum
$sel:type':LoadBalancer' :: LoadBalancer -> Maybe LoadBalancerTypeEnum
type'} -> Maybe LoadBalancerTypeEnum
type') (\s :: LoadBalancer
s@LoadBalancer' {} Maybe LoadBalancerTypeEnum
a -> LoadBalancer
s {$sel:type':LoadBalancer' :: Maybe LoadBalancerTypeEnum
type' = Maybe LoadBalancerTypeEnum
a} :: LoadBalancer)

-- | The public DNS name of the load balancer.
loadBalancer_dNSName :: Lens.Lens' LoadBalancer (Prelude.Maybe Prelude.Text)
loadBalancer_dNSName :: (Maybe Text -> f (Maybe Text)) -> LoadBalancer -> f LoadBalancer
loadBalancer_dNSName = (LoadBalancer -> Maybe Text)
-> (LoadBalancer -> Maybe Text -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe Text
dNSName :: Maybe Text
$sel:dNSName:LoadBalancer' :: LoadBalancer -> Maybe Text
dNSName} -> Maybe Text
dNSName) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe Text
a -> LoadBalancer
s {$sel:dNSName:LoadBalancer' :: Maybe Text
dNSName = Maybe Text
a} :: LoadBalancer)

instance Core.FromXML LoadBalancer where
  parseXML :: [Node] -> Either String LoadBalancer
parseXML [Node]
x =
    Maybe LoadBalancerState
-> Maybe [Text]
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe [AvailabilityZone]
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressType
-> Maybe LoadBalancerSchemeEnum
-> Maybe LoadBalancerTypeEnum
-> Maybe Text
-> LoadBalancer
LoadBalancer'
      (Maybe LoadBalancerState
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe Text
 -> Maybe [AvailabilityZone]
 -> Maybe Text
 -> Maybe Text
 -> Maybe IpAddressType
 -> Maybe LoadBalancerSchemeEnum
 -> Maybe LoadBalancerTypeEnum
 -> Maybe Text
 -> LoadBalancer)
-> Either String (Maybe LoadBalancerState)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe [AvailabilityZone]
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe LoadBalancerState)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"State")
      Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe [AvailabilityZone]
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe [AvailabilityZone]
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => 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
"SecurityGroups" 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
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe [AvailabilityZone]
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe [AvailabilityZone]
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LoadBalancerName")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe [AvailabilityZone]
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [AvailabilityZone]
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CreatedTime")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [AvailabilityZone]
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [AvailabilityZone]
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VpcId")
      Either
  String
  (Maybe Text
   -> Maybe [AvailabilityZone]
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [AvailabilityZone]
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CanonicalHostedZoneId")
      Either
  String
  (Maybe [AvailabilityZone]
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe [AvailabilityZone])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => 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 Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CustomerOwnedIpv4Pool")
      Either
  String
  (Maybe Text
   -> Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe IpAddressType
      -> Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum
      -> Maybe Text
      -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LoadBalancerArn")
      Either
  String
  (Maybe IpAddressType
   -> Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum
   -> Maybe Text
   -> LoadBalancer)
-> Either String (Maybe IpAddressType)
-> Either
     String
     (Maybe LoadBalancerSchemeEnum
      -> Maybe LoadBalancerTypeEnum -> Maybe Text -> LoadBalancer)
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
  (Maybe LoadBalancerSchemeEnum
   -> Maybe LoadBalancerTypeEnum -> Maybe Text -> LoadBalancer)
-> Either String (Maybe LoadBalancerSchemeEnum)
-> Either
     String (Maybe LoadBalancerTypeEnum -> Maybe Text -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LoadBalancerSchemeEnum)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Scheme")
      Either
  String (Maybe LoadBalancerTypeEnum -> Maybe Text -> LoadBalancer)
-> Either String (Maybe LoadBalancerTypeEnum)
-> Either String (Maybe Text -> LoadBalancer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LoadBalancerTypeEnum)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Type")
      Either String (Maybe Text -> LoadBalancer)
-> Either String (Maybe Text) -> Either String LoadBalancer
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DNSName")

instance Prelude.Hashable LoadBalancer

instance Prelude.NFData LoadBalancer