{-# 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.CreateLoadBalancer
-- 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)
--
-- Creates an Application Load Balancer, Network Load Balancer, or Gateway
-- Load Balancer.
--
-- For more information, see the following:
--
-- -   <https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html Application Load Balancers>
--
-- -   <https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html Network Load Balancers>
--
-- -   <https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/gateway-load-balancers.html Gateway Load Balancers>
--
-- This operation is idempotent, which means that it completes at most one
-- time. If you attempt to create multiple load balancers with the same
-- settings, each call succeeds.
module Amazonka.ELBV2.CreateLoadBalancer
  ( -- * Creating a Request
    CreateLoadBalancer (..),
    newCreateLoadBalancer,

    -- * Request Lenses
    createLoadBalancer_subnetMappings,
    createLoadBalancer_securityGroups,
    createLoadBalancer_subnets,
    createLoadBalancer_customerOwnedIpv4Pool,
    createLoadBalancer_ipAddressType,
    createLoadBalancer_scheme,
    createLoadBalancer_type,
    createLoadBalancer_tags,
    createLoadBalancer_name,

    -- * Destructuring the Response
    CreateLoadBalancerResponse (..),
    newCreateLoadBalancerResponse,

    -- * Response Lenses
    createLoadBalancerResponse_loadBalancers,
    createLoadBalancerResponse_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:/ 'newCreateLoadBalancer' smart constructor.
data CreateLoadBalancer = CreateLoadBalancer'
  { -- | 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.
    --
    -- [Gateway Load Balancers] You can specify subnets from one or more
    -- Availability Zones. You cannot specify Elastic IP addresses for your
    -- subnets.
    CreateLoadBalancer -> Maybe [SubnetMapping]
subnetMappings :: Prelude.Maybe [SubnetMapping],
    -- | [Application Load Balancers] The IDs of the security groups for the load
    -- balancer.
    CreateLoadBalancer -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
    -- | 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.
    --
    -- [Gateway Load Balancers] You can specify subnets from one or more
    -- Availability Zones.
    CreateLoadBalancer -> Maybe [Text]
subnets :: Prelude.Maybe [Prelude.Text],
    -- | [Application Load Balancers on Outposts] The ID of the customer-owned
    -- address pool (CoIP pool).
    CreateLoadBalancer -> Maybe Text
customerOwnedIpv4Pool :: 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). Internal load balancers must use @ipv4@.
    CreateLoadBalancer -> 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.
    --
    -- The default is an Internet-facing load balancer.
    --
    -- You cannot specify a scheme for a Gateway Load Balancer.
    CreateLoadBalancer -> Maybe LoadBalancerSchemeEnum
scheme :: Prelude.Maybe LoadBalancerSchemeEnum,
    -- | The type of load balancer. The default is @application@.
    CreateLoadBalancer -> Maybe LoadBalancerTypeEnum
type' :: Prelude.Maybe LoadBalancerTypeEnum,
    -- | The tags to assign to the load balancer.
    CreateLoadBalancer -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The name of the load balancer.
    --
    -- This name must be unique per region per account, can have a maximum of
    -- 32 characters, must contain only alphanumeric characters or hyphens,
    -- must not begin or end with a hyphen, and must not begin with
    -- \"internal-\".
    CreateLoadBalancer -> Text
name :: Prelude.Text
  }
  deriving (CreateLoadBalancer -> CreateLoadBalancer -> Bool
(CreateLoadBalancer -> CreateLoadBalancer -> Bool)
-> (CreateLoadBalancer -> CreateLoadBalancer -> Bool)
-> Eq CreateLoadBalancer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoadBalancer -> CreateLoadBalancer -> Bool
$c/= :: CreateLoadBalancer -> CreateLoadBalancer -> Bool
== :: CreateLoadBalancer -> CreateLoadBalancer -> Bool
$c== :: CreateLoadBalancer -> CreateLoadBalancer -> Bool
Prelude.Eq, ReadPrec [CreateLoadBalancer]
ReadPrec CreateLoadBalancer
Int -> ReadS CreateLoadBalancer
ReadS [CreateLoadBalancer]
(Int -> ReadS CreateLoadBalancer)
-> ReadS [CreateLoadBalancer]
-> ReadPrec CreateLoadBalancer
-> ReadPrec [CreateLoadBalancer]
-> Read CreateLoadBalancer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLoadBalancer]
$creadListPrec :: ReadPrec [CreateLoadBalancer]
readPrec :: ReadPrec CreateLoadBalancer
$creadPrec :: ReadPrec CreateLoadBalancer
readList :: ReadS [CreateLoadBalancer]
$creadList :: ReadS [CreateLoadBalancer]
readsPrec :: Int -> ReadS CreateLoadBalancer
$creadsPrec :: Int -> ReadS CreateLoadBalancer
Prelude.Read, Int -> CreateLoadBalancer -> ShowS
[CreateLoadBalancer] -> ShowS
CreateLoadBalancer -> String
(Int -> CreateLoadBalancer -> ShowS)
-> (CreateLoadBalancer -> String)
-> ([CreateLoadBalancer] -> ShowS)
-> Show CreateLoadBalancer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoadBalancer] -> ShowS
$cshowList :: [CreateLoadBalancer] -> ShowS
show :: CreateLoadBalancer -> String
$cshow :: CreateLoadBalancer -> String
showsPrec :: Int -> CreateLoadBalancer -> ShowS
$cshowsPrec :: Int -> CreateLoadBalancer -> ShowS
Prelude.Show, (forall x. CreateLoadBalancer -> Rep CreateLoadBalancer x)
-> (forall x. Rep CreateLoadBalancer x -> CreateLoadBalancer)
-> Generic CreateLoadBalancer
forall x. Rep CreateLoadBalancer x -> CreateLoadBalancer
forall x. CreateLoadBalancer -> Rep CreateLoadBalancer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLoadBalancer x -> CreateLoadBalancer
$cfrom :: forall x. CreateLoadBalancer -> Rep CreateLoadBalancer x
Prelude.Generic)

-- |
-- Create a value of 'CreateLoadBalancer' 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', 'createLoadBalancer_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.
--
-- [Gateway Load Balancers] You can specify subnets from one or more
-- Availability Zones. You cannot specify Elastic IP addresses for your
-- subnets.
--
-- 'securityGroups', 'createLoadBalancer_securityGroups' - [Application Load Balancers] The IDs of the security groups for the load
-- balancer.
--
-- 'subnets', 'createLoadBalancer_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.
--
-- [Gateway Load Balancers] You can specify subnets from one or more
-- Availability Zones.
--
-- 'customerOwnedIpv4Pool', 'createLoadBalancer_customerOwnedIpv4Pool' - [Application Load Balancers on Outposts] The ID of the customer-owned
-- address pool (CoIP pool).
--
-- 'ipAddressType', 'createLoadBalancer_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). Internal load balancers must use @ipv4@.
--
-- 'scheme', 'createLoadBalancer_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.
--
-- The default is an Internet-facing load balancer.
--
-- You cannot specify a scheme for a Gateway Load Balancer.
--
-- 'type'', 'createLoadBalancer_type' - The type of load balancer. The default is @application@.
--
-- 'tags', 'createLoadBalancer_tags' - The tags to assign to the load balancer.
--
-- 'name', 'createLoadBalancer_name' - The name of the load balancer.
--
-- This name must be unique per region per account, can have a maximum of
-- 32 characters, must contain only alphanumeric characters or hyphens,
-- must not begin or end with a hyphen, and must not begin with
-- \"internal-\".
newCreateLoadBalancer ::
  -- | 'name'
  Prelude.Text ->
  CreateLoadBalancer
newCreateLoadBalancer :: Text -> CreateLoadBalancer
newCreateLoadBalancer Text
pName_ =
  CreateLoadBalancer' :: Maybe [SubnetMapping]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe IpAddressType
-> Maybe LoadBalancerSchemeEnum
-> Maybe LoadBalancerTypeEnum
-> Maybe (NonEmpty Tag)
-> Text
-> CreateLoadBalancer
CreateLoadBalancer'
    { $sel:subnetMappings:CreateLoadBalancer' :: Maybe [SubnetMapping]
subnetMappings =
        Maybe [SubnetMapping]
forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroups:CreateLoadBalancer' :: Maybe [Text]
securityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:subnets:CreateLoadBalancer' :: Maybe [Text]
subnets = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:customerOwnedIpv4Pool:CreateLoadBalancer' :: Maybe Text
customerOwnedIpv4Pool = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:CreateLoadBalancer' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
      $sel:scheme:CreateLoadBalancer' :: Maybe LoadBalancerSchemeEnum
scheme = Maybe LoadBalancerSchemeEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:type':CreateLoadBalancer' :: Maybe LoadBalancerTypeEnum
type' = Maybe LoadBalancerTypeEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateLoadBalancer' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateLoadBalancer' :: Text
name = Text
pName_
    }

-- | 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.
--
-- [Gateway Load Balancers] You can specify subnets from one or more
-- Availability Zones. You cannot specify Elastic IP addresses for your
-- subnets.
createLoadBalancer_subnetMappings :: Lens.Lens' CreateLoadBalancer (Prelude.Maybe [SubnetMapping])
createLoadBalancer_subnetMappings :: (Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> CreateLoadBalancer -> f CreateLoadBalancer
createLoadBalancer_subnetMappings = (CreateLoadBalancer -> Maybe [SubnetMapping])
-> (CreateLoadBalancer
    -> Maybe [SubnetMapping] -> CreateLoadBalancer)
-> Lens
     CreateLoadBalancer
     CreateLoadBalancer
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancer' {Maybe [SubnetMapping]
subnetMappings :: Maybe [SubnetMapping]
$sel:subnetMappings:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe [SubnetMapping]
subnetMappings} -> Maybe [SubnetMapping]
subnetMappings) (\s :: CreateLoadBalancer
s@CreateLoadBalancer' {} Maybe [SubnetMapping]
a -> CreateLoadBalancer
s {$sel:subnetMappings:CreateLoadBalancer' :: Maybe [SubnetMapping]
subnetMappings = Maybe [SubnetMapping]
a} :: CreateLoadBalancer) ((Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
 -> CreateLoadBalancer -> f CreateLoadBalancer)
-> ((Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
    -> Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> (Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> CreateLoadBalancer
-> f CreateLoadBalancer
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

-- | [Application Load Balancers] The IDs of the security groups for the load
-- balancer.
createLoadBalancer_securityGroups :: Lens.Lens' CreateLoadBalancer (Prelude.Maybe [Prelude.Text])
createLoadBalancer_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateLoadBalancer -> f CreateLoadBalancer
createLoadBalancer_securityGroups = (CreateLoadBalancer -> Maybe [Text])
-> (CreateLoadBalancer -> Maybe [Text] -> CreateLoadBalancer)
-> Lens
     CreateLoadBalancer CreateLoadBalancer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancer' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: CreateLoadBalancer
s@CreateLoadBalancer' {} Maybe [Text]
a -> CreateLoadBalancer
s {$sel:securityGroups:CreateLoadBalancer' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: CreateLoadBalancer) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateLoadBalancer -> f CreateLoadBalancer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateLoadBalancer
-> f CreateLoadBalancer
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 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.
--
-- [Gateway Load Balancers] You can specify subnets from one or more
-- Availability Zones.
createLoadBalancer_subnets :: Lens.Lens' CreateLoadBalancer (Prelude.Maybe [Prelude.Text])
createLoadBalancer_subnets :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateLoadBalancer -> f CreateLoadBalancer
createLoadBalancer_subnets = (CreateLoadBalancer -> Maybe [Text])
-> (CreateLoadBalancer -> Maybe [Text] -> CreateLoadBalancer)
-> Lens
     CreateLoadBalancer CreateLoadBalancer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancer' {Maybe [Text]
subnets :: Maybe [Text]
$sel:subnets:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe [Text]
subnets} -> Maybe [Text]
subnets) (\s :: CreateLoadBalancer
s@CreateLoadBalancer' {} Maybe [Text]
a -> CreateLoadBalancer
s {$sel:subnets:CreateLoadBalancer' :: Maybe [Text]
subnets = Maybe [Text]
a} :: CreateLoadBalancer) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateLoadBalancer -> f CreateLoadBalancer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateLoadBalancer
-> f CreateLoadBalancer
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

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

-- | 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). Internal load balancers must use @ipv4@.
createLoadBalancer_ipAddressType :: Lens.Lens' CreateLoadBalancer (Prelude.Maybe IpAddressType)
createLoadBalancer_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> CreateLoadBalancer -> f CreateLoadBalancer
createLoadBalancer_ipAddressType = (CreateLoadBalancer -> Maybe IpAddressType)
-> (CreateLoadBalancer
    -> Maybe IpAddressType -> CreateLoadBalancer)
-> Lens
     CreateLoadBalancer
     CreateLoadBalancer
     (Maybe IpAddressType)
     (Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancer' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: CreateLoadBalancer
s@CreateLoadBalancer' {} Maybe IpAddressType
a -> CreateLoadBalancer
s {$sel:ipAddressType:CreateLoadBalancer' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: CreateLoadBalancer)

-- | 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.
--
-- The default is an Internet-facing load balancer.
--
-- You cannot specify a scheme for a Gateway Load Balancer.
createLoadBalancer_scheme :: Lens.Lens' CreateLoadBalancer (Prelude.Maybe LoadBalancerSchemeEnum)
createLoadBalancer_scheme :: (Maybe LoadBalancerSchemeEnum -> f (Maybe LoadBalancerSchemeEnum))
-> CreateLoadBalancer -> f CreateLoadBalancer
createLoadBalancer_scheme = (CreateLoadBalancer -> Maybe LoadBalancerSchemeEnum)
-> (CreateLoadBalancer
    -> Maybe LoadBalancerSchemeEnum -> CreateLoadBalancer)
-> Lens
     CreateLoadBalancer
     CreateLoadBalancer
     (Maybe LoadBalancerSchemeEnum)
     (Maybe LoadBalancerSchemeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancer' {Maybe LoadBalancerSchemeEnum
scheme :: Maybe LoadBalancerSchemeEnum
$sel:scheme:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe LoadBalancerSchemeEnum
scheme} -> Maybe LoadBalancerSchemeEnum
scheme) (\s :: CreateLoadBalancer
s@CreateLoadBalancer' {} Maybe LoadBalancerSchemeEnum
a -> CreateLoadBalancer
s {$sel:scheme:CreateLoadBalancer' :: Maybe LoadBalancerSchemeEnum
scheme = Maybe LoadBalancerSchemeEnum
a} :: CreateLoadBalancer)

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

-- | The tags to assign to the load balancer.
createLoadBalancer_tags :: Lens.Lens' CreateLoadBalancer (Prelude.Maybe (Prelude.NonEmpty Tag))
createLoadBalancer_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateLoadBalancer -> f CreateLoadBalancer
createLoadBalancer_tags = (CreateLoadBalancer -> Maybe (NonEmpty Tag))
-> (CreateLoadBalancer
    -> Maybe (NonEmpty Tag) -> CreateLoadBalancer)
-> Lens
     CreateLoadBalancer
     CreateLoadBalancer
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancer' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateLoadBalancer
s@CreateLoadBalancer' {} Maybe (NonEmpty Tag)
a -> CreateLoadBalancer
s {$sel:tags:CreateLoadBalancer' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateLoadBalancer) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateLoadBalancer -> f CreateLoadBalancer)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateLoadBalancer
-> f CreateLoadBalancer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the load balancer.
--
-- This name must be unique per region per account, can have a maximum of
-- 32 characters, must contain only alphanumeric characters or hyphens,
-- must not begin or end with a hyphen, and must not begin with
-- \"internal-\".
createLoadBalancer_name :: Lens.Lens' CreateLoadBalancer Prelude.Text
createLoadBalancer_name :: (Text -> f Text) -> CreateLoadBalancer -> f CreateLoadBalancer
createLoadBalancer_name = (CreateLoadBalancer -> Text)
-> (CreateLoadBalancer -> Text -> CreateLoadBalancer)
-> Lens CreateLoadBalancer CreateLoadBalancer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancer' {Text
name :: Text
$sel:name:CreateLoadBalancer' :: CreateLoadBalancer -> Text
name} -> Text
name) (\s :: CreateLoadBalancer
s@CreateLoadBalancer' {} Text
a -> CreateLoadBalancer
s {$sel:name:CreateLoadBalancer' :: Text
name = Text
a} :: CreateLoadBalancer)

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

instance Prelude.NFData CreateLoadBalancer

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

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

instance Core.ToQuery CreateLoadBalancer where
  toQuery :: CreateLoadBalancer -> QueryString
toQuery CreateLoadBalancer' {Maybe [Text]
Maybe [SubnetMapping]
Maybe (NonEmpty Tag)
Maybe Text
Maybe IpAddressType
Maybe LoadBalancerSchemeEnum
Maybe LoadBalancerTypeEnum
Text
name :: Text
tags :: Maybe (NonEmpty Tag)
type' :: Maybe LoadBalancerTypeEnum
scheme :: Maybe LoadBalancerSchemeEnum
ipAddressType :: Maybe IpAddressType
customerOwnedIpv4Pool :: Maybe Text
subnets :: Maybe [Text]
securityGroups :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
$sel:name:CreateLoadBalancer' :: CreateLoadBalancer -> Text
$sel:tags:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe (NonEmpty Tag)
$sel:type':CreateLoadBalancer' :: CreateLoadBalancer -> Maybe LoadBalancerTypeEnum
$sel:scheme:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe LoadBalancerSchemeEnum
$sel:ipAddressType:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe IpAddressType
$sel:customerOwnedIpv4Pool:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe Text
$sel:subnets:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe [Text]
$sel:securityGroups:CreateLoadBalancer' :: CreateLoadBalancer -> Maybe [Text]
$sel:subnetMappings:CreateLoadBalancer' :: CreateLoadBalancer -> 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
"CreateLoadBalancer" :: 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
"SecurityGroups"
          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]
securityGroups
            ),
        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
"CustomerOwnedIpv4Pool"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
customerOwnedIpv4Pool,
        ByteString
"IpAddressType" ByteString -> Maybe IpAddressType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe IpAddressType
ipAddressType,
        ByteString
"Scheme" ByteString -> Maybe LoadBalancerSchemeEnum -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LoadBalancerSchemeEnum
scheme,
        ByteString
"Type" ByteString -> Maybe LoadBalancerTypeEnum -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LoadBalancerTypeEnum
type',
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> NonEmpty Tag -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" (NonEmpty Tag -> QueryString)
-> Maybe (NonEmpty Tag) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags),
        ByteString
"Name" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
name
      ]

-- | /See:/ 'newCreateLoadBalancerResponse' smart constructor.
data CreateLoadBalancerResponse = CreateLoadBalancerResponse'
  { -- | Information about the load balancer.
    CreateLoadBalancerResponse -> Maybe [LoadBalancer]
loadBalancers :: Prelude.Maybe [LoadBalancer],
    -- | The response's http status code.
    CreateLoadBalancerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLoadBalancerResponse -> CreateLoadBalancerResponse -> Bool
(CreateLoadBalancerResponse -> CreateLoadBalancerResponse -> Bool)
-> (CreateLoadBalancerResponse
    -> CreateLoadBalancerResponse -> Bool)
-> Eq CreateLoadBalancerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoadBalancerResponse -> CreateLoadBalancerResponse -> Bool
$c/= :: CreateLoadBalancerResponse -> CreateLoadBalancerResponse -> Bool
== :: CreateLoadBalancerResponse -> CreateLoadBalancerResponse -> Bool
$c== :: CreateLoadBalancerResponse -> CreateLoadBalancerResponse -> Bool
Prelude.Eq, ReadPrec [CreateLoadBalancerResponse]
ReadPrec CreateLoadBalancerResponse
Int -> ReadS CreateLoadBalancerResponse
ReadS [CreateLoadBalancerResponse]
(Int -> ReadS CreateLoadBalancerResponse)
-> ReadS [CreateLoadBalancerResponse]
-> ReadPrec CreateLoadBalancerResponse
-> ReadPrec [CreateLoadBalancerResponse]
-> Read CreateLoadBalancerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLoadBalancerResponse]
$creadListPrec :: ReadPrec [CreateLoadBalancerResponse]
readPrec :: ReadPrec CreateLoadBalancerResponse
$creadPrec :: ReadPrec CreateLoadBalancerResponse
readList :: ReadS [CreateLoadBalancerResponse]
$creadList :: ReadS [CreateLoadBalancerResponse]
readsPrec :: Int -> ReadS CreateLoadBalancerResponse
$creadsPrec :: Int -> ReadS CreateLoadBalancerResponse
Prelude.Read, Int -> CreateLoadBalancerResponse -> ShowS
[CreateLoadBalancerResponse] -> ShowS
CreateLoadBalancerResponse -> String
(Int -> CreateLoadBalancerResponse -> ShowS)
-> (CreateLoadBalancerResponse -> String)
-> ([CreateLoadBalancerResponse] -> ShowS)
-> Show CreateLoadBalancerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoadBalancerResponse] -> ShowS
$cshowList :: [CreateLoadBalancerResponse] -> ShowS
show :: CreateLoadBalancerResponse -> String
$cshow :: CreateLoadBalancerResponse -> String
showsPrec :: Int -> CreateLoadBalancerResponse -> ShowS
$cshowsPrec :: Int -> CreateLoadBalancerResponse -> ShowS
Prelude.Show, (forall x.
 CreateLoadBalancerResponse -> Rep CreateLoadBalancerResponse x)
-> (forall x.
    Rep CreateLoadBalancerResponse x -> CreateLoadBalancerResponse)
-> Generic CreateLoadBalancerResponse
forall x.
Rep CreateLoadBalancerResponse x -> CreateLoadBalancerResponse
forall x.
CreateLoadBalancerResponse -> Rep CreateLoadBalancerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLoadBalancerResponse x -> CreateLoadBalancerResponse
$cfrom :: forall x.
CreateLoadBalancerResponse -> Rep CreateLoadBalancerResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLoadBalancerResponse' 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:
--
-- 'loadBalancers', 'createLoadBalancerResponse_loadBalancers' - Information about the load balancer.
--
-- 'httpStatus', 'createLoadBalancerResponse_httpStatus' - The response's http status code.
newCreateLoadBalancerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLoadBalancerResponse
newCreateLoadBalancerResponse :: Int -> CreateLoadBalancerResponse
newCreateLoadBalancerResponse Int
pHttpStatus_ =
  CreateLoadBalancerResponse' :: Maybe [LoadBalancer] -> Int -> CreateLoadBalancerResponse
CreateLoadBalancerResponse'
    { $sel:loadBalancers:CreateLoadBalancerResponse' :: Maybe [LoadBalancer]
loadBalancers =
        Maybe [LoadBalancer]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLoadBalancerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the load balancer.
createLoadBalancerResponse_loadBalancers :: Lens.Lens' CreateLoadBalancerResponse (Prelude.Maybe [LoadBalancer])
createLoadBalancerResponse_loadBalancers :: (Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> CreateLoadBalancerResponse -> f CreateLoadBalancerResponse
createLoadBalancerResponse_loadBalancers = (CreateLoadBalancerResponse -> Maybe [LoadBalancer])
-> (CreateLoadBalancerResponse
    -> Maybe [LoadBalancer] -> CreateLoadBalancerResponse)
-> Lens
     CreateLoadBalancerResponse
     CreateLoadBalancerResponse
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancerResponse' {Maybe [LoadBalancer]
loadBalancers :: Maybe [LoadBalancer]
$sel:loadBalancers:CreateLoadBalancerResponse' :: CreateLoadBalancerResponse -> Maybe [LoadBalancer]
loadBalancers} -> Maybe [LoadBalancer]
loadBalancers) (\s :: CreateLoadBalancerResponse
s@CreateLoadBalancerResponse' {} Maybe [LoadBalancer]
a -> CreateLoadBalancerResponse
s {$sel:loadBalancers:CreateLoadBalancerResponse' :: Maybe [LoadBalancer]
loadBalancers = Maybe [LoadBalancer]
a} :: CreateLoadBalancerResponse) ((Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
 -> CreateLoadBalancerResponse -> f CreateLoadBalancerResponse)
-> ((Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
    -> Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> (Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> CreateLoadBalancerResponse
-> f CreateLoadBalancerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [LoadBalancer] [LoadBalancer] [LoadBalancer] [LoadBalancer]
-> Iso
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
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 [LoadBalancer] [LoadBalancer] [LoadBalancer] [LoadBalancer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateLoadBalancerResponse