{-# 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 #-}
module Amazonka.ELBV2.CreateLoadBalancer
(
CreateLoadBalancer (..),
newCreateLoadBalancer,
createLoadBalancer_subnetMappings,
createLoadBalancer_securityGroups,
createLoadBalancer_subnets,
createLoadBalancer_customerOwnedIpv4Pool,
createLoadBalancer_ipAddressType,
createLoadBalancer_scheme,
createLoadBalancer_type,
createLoadBalancer_tags,
createLoadBalancer_name,
CreateLoadBalancerResponse (..),
newCreateLoadBalancerResponse,
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
data CreateLoadBalancer = CreateLoadBalancer'
{
CreateLoadBalancer -> Maybe [SubnetMapping]
subnetMappings :: Prelude.Maybe [SubnetMapping],
CreateLoadBalancer -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
CreateLoadBalancer -> Maybe [Text]
subnets :: Prelude.Maybe [Prelude.Text],
CreateLoadBalancer -> Maybe Text
customerOwnedIpv4Pool :: Prelude.Maybe Prelude.Text,
CreateLoadBalancer -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
CreateLoadBalancer -> Maybe LoadBalancerSchemeEnum
scheme :: Prelude.Maybe LoadBalancerSchemeEnum,
CreateLoadBalancer -> Maybe LoadBalancerTypeEnum
type' :: Prelude.Maybe LoadBalancerTypeEnum,
CreateLoadBalancer -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
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)
newCreateLoadBalancer ::
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_
}
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
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
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
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)
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)
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)
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)
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
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
]
data CreateLoadBalancerResponse = CreateLoadBalancerResponse'
{
CreateLoadBalancerResponse -> Maybe [LoadBalancer]
loadBalancers :: Prelude.Maybe [LoadBalancer],
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)
newCreateLoadBalancerResponse ::
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_
}
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
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