{-# 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.ELB.CreateLoadBalancerListeners
(
CreateLoadBalancerListeners (..),
newCreateLoadBalancerListeners,
createLoadBalancerListeners_loadBalancerName,
createLoadBalancerListeners_listeners,
CreateLoadBalancerListenersResponse (..),
newCreateLoadBalancerListenersResponse,
createLoadBalancerListenersResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ELB.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 CreateLoadBalancerListeners = CreateLoadBalancerListeners'
{
CreateLoadBalancerListeners -> Text
loadBalancerName :: Prelude.Text,
CreateLoadBalancerListeners -> [Listener]
listeners :: [Listener]
}
deriving (CreateLoadBalancerListeners -> CreateLoadBalancerListeners -> Bool
(CreateLoadBalancerListeners
-> CreateLoadBalancerListeners -> Bool)
-> (CreateLoadBalancerListeners
-> CreateLoadBalancerListeners -> Bool)
-> Eq CreateLoadBalancerListeners
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoadBalancerListeners -> CreateLoadBalancerListeners -> Bool
$c/= :: CreateLoadBalancerListeners -> CreateLoadBalancerListeners -> Bool
== :: CreateLoadBalancerListeners -> CreateLoadBalancerListeners -> Bool
$c== :: CreateLoadBalancerListeners -> CreateLoadBalancerListeners -> Bool
Prelude.Eq, ReadPrec [CreateLoadBalancerListeners]
ReadPrec CreateLoadBalancerListeners
Int -> ReadS CreateLoadBalancerListeners
ReadS [CreateLoadBalancerListeners]
(Int -> ReadS CreateLoadBalancerListeners)
-> ReadS [CreateLoadBalancerListeners]
-> ReadPrec CreateLoadBalancerListeners
-> ReadPrec [CreateLoadBalancerListeners]
-> Read CreateLoadBalancerListeners
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLoadBalancerListeners]
$creadListPrec :: ReadPrec [CreateLoadBalancerListeners]
readPrec :: ReadPrec CreateLoadBalancerListeners
$creadPrec :: ReadPrec CreateLoadBalancerListeners
readList :: ReadS [CreateLoadBalancerListeners]
$creadList :: ReadS [CreateLoadBalancerListeners]
readsPrec :: Int -> ReadS CreateLoadBalancerListeners
$creadsPrec :: Int -> ReadS CreateLoadBalancerListeners
Prelude.Read, Int -> CreateLoadBalancerListeners -> ShowS
[CreateLoadBalancerListeners] -> ShowS
CreateLoadBalancerListeners -> String
(Int -> CreateLoadBalancerListeners -> ShowS)
-> (CreateLoadBalancerListeners -> String)
-> ([CreateLoadBalancerListeners] -> ShowS)
-> Show CreateLoadBalancerListeners
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoadBalancerListeners] -> ShowS
$cshowList :: [CreateLoadBalancerListeners] -> ShowS
show :: CreateLoadBalancerListeners -> String
$cshow :: CreateLoadBalancerListeners -> String
showsPrec :: Int -> CreateLoadBalancerListeners -> ShowS
$cshowsPrec :: Int -> CreateLoadBalancerListeners -> ShowS
Prelude.Show, (forall x.
CreateLoadBalancerListeners -> Rep CreateLoadBalancerListeners x)
-> (forall x.
Rep CreateLoadBalancerListeners x -> CreateLoadBalancerListeners)
-> Generic CreateLoadBalancerListeners
forall x.
Rep CreateLoadBalancerListeners x -> CreateLoadBalancerListeners
forall x.
CreateLoadBalancerListeners -> Rep CreateLoadBalancerListeners x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLoadBalancerListeners x -> CreateLoadBalancerListeners
$cfrom :: forall x.
CreateLoadBalancerListeners -> Rep CreateLoadBalancerListeners x
Prelude.Generic)
newCreateLoadBalancerListeners ::
Prelude.Text ->
CreateLoadBalancerListeners
newCreateLoadBalancerListeners :: Text -> CreateLoadBalancerListeners
newCreateLoadBalancerListeners Text
pLoadBalancerName_ =
CreateLoadBalancerListeners' :: Text -> [Listener] -> CreateLoadBalancerListeners
CreateLoadBalancerListeners'
{ $sel:loadBalancerName:CreateLoadBalancerListeners' :: Text
loadBalancerName =
Text
pLoadBalancerName_,
$sel:listeners:CreateLoadBalancerListeners' :: [Listener]
listeners = [Listener]
forall a. Monoid a => a
Prelude.mempty
}
createLoadBalancerListeners_loadBalancerName :: Lens.Lens' CreateLoadBalancerListeners Prelude.Text
createLoadBalancerListeners_loadBalancerName :: (Text -> f Text)
-> CreateLoadBalancerListeners -> f CreateLoadBalancerListeners
createLoadBalancerListeners_loadBalancerName = (CreateLoadBalancerListeners -> Text)
-> (CreateLoadBalancerListeners
-> Text -> CreateLoadBalancerListeners)
-> Lens
CreateLoadBalancerListeners CreateLoadBalancerListeners Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancerListeners' {Text
loadBalancerName :: Text
$sel:loadBalancerName:CreateLoadBalancerListeners' :: CreateLoadBalancerListeners -> Text
loadBalancerName} -> Text
loadBalancerName) (\s :: CreateLoadBalancerListeners
s@CreateLoadBalancerListeners' {} Text
a -> CreateLoadBalancerListeners
s {$sel:loadBalancerName:CreateLoadBalancerListeners' :: Text
loadBalancerName = Text
a} :: CreateLoadBalancerListeners)
createLoadBalancerListeners_listeners :: Lens.Lens' CreateLoadBalancerListeners [Listener]
createLoadBalancerListeners_listeners :: ([Listener] -> f [Listener])
-> CreateLoadBalancerListeners -> f CreateLoadBalancerListeners
createLoadBalancerListeners_listeners = (CreateLoadBalancerListeners -> [Listener])
-> (CreateLoadBalancerListeners
-> [Listener] -> CreateLoadBalancerListeners)
-> Lens
CreateLoadBalancerListeners
CreateLoadBalancerListeners
[Listener]
[Listener]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancerListeners' {[Listener]
listeners :: [Listener]
$sel:listeners:CreateLoadBalancerListeners' :: CreateLoadBalancerListeners -> [Listener]
listeners} -> [Listener]
listeners) (\s :: CreateLoadBalancerListeners
s@CreateLoadBalancerListeners' {} [Listener]
a -> CreateLoadBalancerListeners
s {$sel:listeners:CreateLoadBalancerListeners' :: [Listener]
listeners = [Listener]
a} :: CreateLoadBalancerListeners) (([Listener] -> f [Listener])
-> CreateLoadBalancerListeners -> f CreateLoadBalancerListeners)
-> (([Listener] -> f [Listener]) -> [Listener] -> f [Listener])
-> ([Listener] -> f [Listener])
-> CreateLoadBalancerListeners
-> f CreateLoadBalancerListeners
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Listener] -> f [Listener]) -> [Listener] -> f [Listener]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest CreateLoadBalancerListeners where
type
AWSResponse CreateLoadBalancerListeners =
CreateLoadBalancerListenersResponse
request :: CreateLoadBalancerListeners -> Request CreateLoadBalancerListeners
request = Service
-> CreateLoadBalancerListeners
-> Request CreateLoadBalancerListeners
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateLoadBalancerListeners
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateLoadBalancerListeners)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateLoadBalancerListeners))
-> Logger
-> Service
-> Proxy CreateLoadBalancerListeners
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateLoadBalancerListeners)))
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
"CreateLoadBalancerListenersResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateLoadBalancerListenersResponse
CreateLoadBalancerListenersResponse'
(Int -> CreateLoadBalancerListenersResponse)
-> Either String Int
-> Either String CreateLoadBalancerListenersResponse
forall (f :: * -> *) a b. Functor 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 CreateLoadBalancerListeners
instance Prelude.NFData CreateLoadBalancerListeners
instance Core.ToHeaders CreateLoadBalancerListeners where
toHeaders :: CreateLoadBalancerListeners -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateLoadBalancerListeners -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateLoadBalancerListeners where
toPath :: CreateLoadBalancerListeners -> ByteString
toPath = ByteString -> CreateLoadBalancerListeners -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateLoadBalancerListeners where
toQuery :: CreateLoadBalancerListeners -> QueryString
toQuery CreateLoadBalancerListeners' {[Listener]
Text
listeners :: [Listener]
loadBalancerName :: Text
$sel:listeners:CreateLoadBalancerListeners' :: CreateLoadBalancerListeners -> [Listener]
$sel:loadBalancerName:CreateLoadBalancerListeners' :: CreateLoadBalancerListeners -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"CreateLoadBalancerListeners" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-06-01" :: Prelude.ByteString),
ByteString
"LoadBalancerName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
loadBalancerName,
ByteString
"Listeners"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Listener] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Listener]
listeners
]
data CreateLoadBalancerListenersResponse = CreateLoadBalancerListenersResponse'
{
CreateLoadBalancerListenersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateLoadBalancerListenersResponse
-> CreateLoadBalancerListenersResponse -> Bool
(CreateLoadBalancerListenersResponse
-> CreateLoadBalancerListenersResponse -> Bool)
-> (CreateLoadBalancerListenersResponse
-> CreateLoadBalancerListenersResponse -> Bool)
-> Eq CreateLoadBalancerListenersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoadBalancerListenersResponse
-> CreateLoadBalancerListenersResponse -> Bool
$c/= :: CreateLoadBalancerListenersResponse
-> CreateLoadBalancerListenersResponse -> Bool
== :: CreateLoadBalancerListenersResponse
-> CreateLoadBalancerListenersResponse -> Bool
$c== :: CreateLoadBalancerListenersResponse
-> CreateLoadBalancerListenersResponse -> Bool
Prelude.Eq, ReadPrec [CreateLoadBalancerListenersResponse]
ReadPrec CreateLoadBalancerListenersResponse
Int -> ReadS CreateLoadBalancerListenersResponse
ReadS [CreateLoadBalancerListenersResponse]
(Int -> ReadS CreateLoadBalancerListenersResponse)
-> ReadS [CreateLoadBalancerListenersResponse]
-> ReadPrec CreateLoadBalancerListenersResponse
-> ReadPrec [CreateLoadBalancerListenersResponse]
-> Read CreateLoadBalancerListenersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLoadBalancerListenersResponse]
$creadListPrec :: ReadPrec [CreateLoadBalancerListenersResponse]
readPrec :: ReadPrec CreateLoadBalancerListenersResponse
$creadPrec :: ReadPrec CreateLoadBalancerListenersResponse
readList :: ReadS [CreateLoadBalancerListenersResponse]
$creadList :: ReadS [CreateLoadBalancerListenersResponse]
readsPrec :: Int -> ReadS CreateLoadBalancerListenersResponse
$creadsPrec :: Int -> ReadS CreateLoadBalancerListenersResponse
Prelude.Read, Int -> CreateLoadBalancerListenersResponse -> ShowS
[CreateLoadBalancerListenersResponse] -> ShowS
CreateLoadBalancerListenersResponse -> String
(Int -> CreateLoadBalancerListenersResponse -> ShowS)
-> (CreateLoadBalancerListenersResponse -> String)
-> ([CreateLoadBalancerListenersResponse] -> ShowS)
-> Show CreateLoadBalancerListenersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoadBalancerListenersResponse] -> ShowS
$cshowList :: [CreateLoadBalancerListenersResponse] -> ShowS
show :: CreateLoadBalancerListenersResponse -> String
$cshow :: CreateLoadBalancerListenersResponse -> String
showsPrec :: Int -> CreateLoadBalancerListenersResponse -> ShowS
$cshowsPrec :: Int -> CreateLoadBalancerListenersResponse -> ShowS
Prelude.Show, (forall x.
CreateLoadBalancerListenersResponse
-> Rep CreateLoadBalancerListenersResponse x)
-> (forall x.
Rep CreateLoadBalancerListenersResponse x
-> CreateLoadBalancerListenersResponse)
-> Generic CreateLoadBalancerListenersResponse
forall x.
Rep CreateLoadBalancerListenersResponse x
-> CreateLoadBalancerListenersResponse
forall x.
CreateLoadBalancerListenersResponse
-> Rep CreateLoadBalancerListenersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLoadBalancerListenersResponse x
-> CreateLoadBalancerListenersResponse
$cfrom :: forall x.
CreateLoadBalancerListenersResponse
-> Rep CreateLoadBalancerListenersResponse x
Prelude.Generic)
newCreateLoadBalancerListenersResponse ::
Prelude.Int ->
CreateLoadBalancerListenersResponse
newCreateLoadBalancerListenersResponse :: Int -> CreateLoadBalancerListenersResponse
newCreateLoadBalancerListenersResponse Int
pHttpStatus_ =
CreateLoadBalancerListenersResponse' :: Int -> CreateLoadBalancerListenersResponse
CreateLoadBalancerListenersResponse'
{ $sel:httpStatus:CreateLoadBalancerListenersResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createLoadBalancerListenersResponse_httpStatus :: Lens.Lens' CreateLoadBalancerListenersResponse Prelude.Int
createLoadBalancerListenersResponse_httpStatus :: (Int -> f Int)
-> CreateLoadBalancerListenersResponse
-> f CreateLoadBalancerListenersResponse
createLoadBalancerListenersResponse_httpStatus = (CreateLoadBalancerListenersResponse -> Int)
-> (CreateLoadBalancerListenersResponse
-> Int -> CreateLoadBalancerListenersResponse)
-> Lens
CreateLoadBalancerListenersResponse
CreateLoadBalancerListenersResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoadBalancerListenersResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLoadBalancerListenersResponse' :: CreateLoadBalancerListenersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateLoadBalancerListenersResponse
s@CreateLoadBalancerListenersResponse' {} Int
a -> CreateLoadBalancerListenersResponse
s {$sel:httpStatus:CreateLoadBalancerListenersResponse' :: Int
httpStatus = Int
a} :: CreateLoadBalancerListenersResponse)
instance
Prelude.NFData
CreateLoadBalancerListenersResponse