{-# 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.OpsWorks.AttachElasticLoadBalancer
(
AttachElasticLoadBalancer (..),
newAttachElasticLoadBalancer,
attachElasticLoadBalancer_elasticLoadBalancerName,
attachElasticLoadBalancer_layerId,
AttachElasticLoadBalancerResponse (..),
newAttachElasticLoadBalancerResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AttachElasticLoadBalancer = AttachElasticLoadBalancer'
{
AttachElasticLoadBalancer -> Text
elasticLoadBalancerName :: Prelude.Text,
AttachElasticLoadBalancer -> Text
layerId :: Prelude.Text
}
deriving (AttachElasticLoadBalancer -> AttachElasticLoadBalancer -> Bool
(AttachElasticLoadBalancer -> AttachElasticLoadBalancer -> Bool)
-> (AttachElasticLoadBalancer -> AttachElasticLoadBalancer -> Bool)
-> Eq AttachElasticLoadBalancer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachElasticLoadBalancer -> AttachElasticLoadBalancer -> Bool
$c/= :: AttachElasticLoadBalancer -> AttachElasticLoadBalancer -> Bool
== :: AttachElasticLoadBalancer -> AttachElasticLoadBalancer -> Bool
$c== :: AttachElasticLoadBalancer -> AttachElasticLoadBalancer -> Bool
Prelude.Eq, ReadPrec [AttachElasticLoadBalancer]
ReadPrec AttachElasticLoadBalancer
Int -> ReadS AttachElasticLoadBalancer
ReadS [AttachElasticLoadBalancer]
(Int -> ReadS AttachElasticLoadBalancer)
-> ReadS [AttachElasticLoadBalancer]
-> ReadPrec AttachElasticLoadBalancer
-> ReadPrec [AttachElasticLoadBalancer]
-> Read AttachElasticLoadBalancer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachElasticLoadBalancer]
$creadListPrec :: ReadPrec [AttachElasticLoadBalancer]
readPrec :: ReadPrec AttachElasticLoadBalancer
$creadPrec :: ReadPrec AttachElasticLoadBalancer
readList :: ReadS [AttachElasticLoadBalancer]
$creadList :: ReadS [AttachElasticLoadBalancer]
readsPrec :: Int -> ReadS AttachElasticLoadBalancer
$creadsPrec :: Int -> ReadS AttachElasticLoadBalancer
Prelude.Read, Int -> AttachElasticLoadBalancer -> ShowS
[AttachElasticLoadBalancer] -> ShowS
AttachElasticLoadBalancer -> String
(Int -> AttachElasticLoadBalancer -> ShowS)
-> (AttachElasticLoadBalancer -> String)
-> ([AttachElasticLoadBalancer] -> ShowS)
-> Show AttachElasticLoadBalancer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachElasticLoadBalancer] -> ShowS
$cshowList :: [AttachElasticLoadBalancer] -> ShowS
show :: AttachElasticLoadBalancer -> String
$cshow :: AttachElasticLoadBalancer -> String
showsPrec :: Int -> AttachElasticLoadBalancer -> ShowS
$cshowsPrec :: Int -> AttachElasticLoadBalancer -> ShowS
Prelude.Show, (forall x.
AttachElasticLoadBalancer -> Rep AttachElasticLoadBalancer x)
-> (forall x.
Rep AttachElasticLoadBalancer x -> AttachElasticLoadBalancer)
-> Generic AttachElasticLoadBalancer
forall x.
Rep AttachElasticLoadBalancer x -> AttachElasticLoadBalancer
forall x.
AttachElasticLoadBalancer -> Rep AttachElasticLoadBalancer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachElasticLoadBalancer x -> AttachElasticLoadBalancer
$cfrom :: forall x.
AttachElasticLoadBalancer -> Rep AttachElasticLoadBalancer x
Prelude.Generic)
newAttachElasticLoadBalancer ::
Prelude.Text ->
Prelude.Text ->
AttachElasticLoadBalancer
newAttachElasticLoadBalancer :: Text -> Text -> AttachElasticLoadBalancer
newAttachElasticLoadBalancer
Text
pElasticLoadBalancerName_
Text
pLayerId_ =
AttachElasticLoadBalancer' :: Text -> Text -> AttachElasticLoadBalancer
AttachElasticLoadBalancer'
{ $sel:elasticLoadBalancerName:AttachElasticLoadBalancer' :: Text
elasticLoadBalancerName =
Text
pElasticLoadBalancerName_,
$sel:layerId:AttachElasticLoadBalancer' :: Text
layerId = Text
pLayerId_
}
attachElasticLoadBalancer_elasticLoadBalancerName :: Lens.Lens' AttachElasticLoadBalancer Prelude.Text
attachElasticLoadBalancer_elasticLoadBalancerName :: (Text -> f Text)
-> AttachElasticLoadBalancer -> f AttachElasticLoadBalancer
attachElasticLoadBalancer_elasticLoadBalancerName = (AttachElasticLoadBalancer -> Text)
-> (AttachElasticLoadBalancer -> Text -> AttachElasticLoadBalancer)
-> Lens
AttachElasticLoadBalancer AttachElasticLoadBalancer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachElasticLoadBalancer' {Text
elasticLoadBalancerName :: Text
$sel:elasticLoadBalancerName:AttachElasticLoadBalancer' :: AttachElasticLoadBalancer -> Text
elasticLoadBalancerName} -> Text
elasticLoadBalancerName) (\s :: AttachElasticLoadBalancer
s@AttachElasticLoadBalancer' {} Text
a -> AttachElasticLoadBalancer
s {$sel:elasticLoadBalancerName:AttachElasticLoadBalancer' :: Text
elasticLoadBalancerName = Text
a} :: AttachElasticLoadBalancer)
attachElasticLoadBalancer_layerId :: Lens.Lens' AttachElasticLoadBalancer Prelude.Text
attachElasticLoadBalancer_layerId :: (Text -> f Text)
-> AttachElasticLoadBalancer -> f AttachElasticLoadBalancer
attachElasticLoadBalancer_layerId = (AttachElasticLoadBalancer -> Text)
-> (AttachElasticLoadBalancer -> Text -> AttachElasticLoadBalancer)
-> Lens
AttachElasticLoadBalancer AttachElasticLoadBalancer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachElasticLoadBalancer' {Text
layerId :: Text
$sel:layerId:AttachElasticLoadBalancer' :: AttachElasticLoadBalancer -> Text
layerId} -> Text
layerId) (\s :: AttachElasticLoadBalancer
s@AttachElasticLoadBalancer' {} Text
a -> AttachElasticLoadBalancer
s {$sel:layerId:AttachElasticLoadBalancer' :: Text
layerId = Text
a} :: AttachElasticLoadBalancer)
instance Core.AWSRequest AttachElasticLoadBalancer where
type
AWSResponse AttachElasticLoadBalancer =
AttachElasticLoadBalancerResponse
request :: AttachElasticLoadBalancer -> Request AttachElasticLoadBalancer
request = Service
-> AttachElasticLoadBalancer -> Request AttachElasticLoadBalancer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AttachElasticLoadBalancer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AttachElasticLoadBalancer)))
response =
AWSResponse AttachElasticLoadBalancer
-> Logger
-> Service
-> Proxy AttachElasticLoadBalancer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AttachElasticLoadBalancer)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse AttachElasticLoadBalancer
AttachElasticLoadBalancerResponse
AttachElasticLoadBalancerResponse'
instance Prelude.Hashable AttachElasticLoadBalancer
instance Prelude.NFData AttachElasticLoadBalancer
instance Core.ToHeaders AttachElasticLoadBalancer where
toHeaders :: AttachElasticLoadBalancer -> [Header]
toHeaders =
[Header] -> AttachElasticLoadBalancer -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"OpsWorks_20130218.AttachElasticLoadBalancer" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON AttachElasticLoadBalancer where
toJSON :: AttachElasticLoadBalancer -> Value
toJSON AttachElasticLoadBalancer' {Text
layerId :: Text
elasticLoadBalancerName :: Text
$sel:layerId:AttachElasticLoadBalancer' :: AttachElasticLoadBalancer -> Text
$sel:elasticLoadBalancerName:AttachElasticLoadBalancer' :: AttachElasticLoadBalancer -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ElasticLoadBalancerName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
elasticLoadBalancerName
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LayerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
layerId)
]
)
instance Core.ToPath AttachElasticLoadBalancer where
toPath :: AttachElasticLoadBalancer -> ByteString
toPath = ByteString -> AttachElasticLoadBalancer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AttachElasticLoadBalancer where
toQuery :: AttachElasticLoadBalancer -> QueryString
toQuery = QueryString -> AttachElasticLoadBalancer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AttachElasticLoadBalancerResponse = AttachElasticLoadBalancerResponse'
{
}
deriving (AttachElasticLoadBalancerResponse
-> AttachElasticLoadBalancerResponse -> Bool
(AttachElasticLoadBalancerResponse
-> AttachElasticLoadBalancerResponse -> Bool)
-> (AttachElasticLoadBalancerResponse
-> AttachElasticLoadBalancerResponse -> Bool)
-> Eq AttachElasticLoadBalancerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachElasticLoadBalancerResponse
-> AttachElasticLoadBalancerResponse -> Bool
$c/= :: AttachElasticLoadBalancerResponse
-> AttachElasticLoadBalancerResponse -> Bool
== :: AttachElasticLoadBalancerResponse
-> AttachElasticLoadBalancerResponse -> Bool
$c== :: AttachElasticLoadBalancerResponse
-> AttachElasticLoadBalancerResponse -> Bool
Prelude.Eq, ReadPrec [AttachElasticLoadBalancerResponse]
ReadPrec AttachElasticLoadBalancerResponse
Int -> ReadS AttachElasticLoadBalancerResponse
ReadS [AttachElasticLoadBalancerResponse]
(Int -> ReadS AttachElasticLoadBalancerResponse)
-> ReadS [AttachElasticLoadBalancerResponse]
-> ReadPrec AttachElasticLoadBalancerResponse
-> ReadPrec [AttachElasticLoadBalancerResponse]
-> Read AttachElasticLoadBalancerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachElasticLoadBalancerResponse]
$creadListPrec :: ReadPrec [AttachElasticLoadBalancerResponse]
readPrec :: ReadPrec AttachElasticLoadBalancerResponse
$creadPrec :: ReadPrec AttachElasticLoadBalancerResponse
readList :: ReadS [AttachElasticLoadBalancerResponse]
$creadList :: ReadS [AttachElasticLoadBalancerResponse]
readsPrec :: Int -> ReadS AttachElasticLoadBalancerResponse
$creadsPrec :: Int -> ReadS AttachElasticLoadBalancerResponse
Prelude.Read, Int -> AttachElasticLoadBalancerResponse -> ShowS
[AttachElasticLoadBalancerResponse] -> ShowS
AttachElasticLoadBalancerResponse -> String
(Int -> AttachElasticLoadBalancerResponse -> ShowS)
-> (AttachElasticLoadBalancerResponse -> String)
-> ([AttachElasticLoadBalancerResponse] -> ShowS)
-> Show AttachElasticLoadBalancerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachElasticLoadBalancerResponse] -> ShowS
$cshowList :: [AttachElasticLoadBalancerResponse] -> ShowS
show :: AttachElasticLoadBalancerResponse -> String
$cshow :: AttachElasticLoadBalancerResponse -> String
showsPrec :: Int -> AttachElasticLoadBalancerResponse -> ShowS
$cshowsPrec :: Int -> AttachElasticLoadBalancerResponse -> ShowS
Prelude.Show, (forall x.
AttachElasticLoadBalancerResponse
-> Rep AttachElasticLoadBalancerResponse x)
-> (forall x.
Rep AttachElasticLoadBalancerResponse x
-> AttachElasticLoadBalancerResponse)
-> Generic AttachElasticLoadBalancerResponse
forall x.
Rep AttachElasticLoadBalancerResponse x
-> AttachElasticLoadBalancerResponse
forall x.
AttachElasticLoadBalancerResponse
-> Rep AttachElasticLoadBalancerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachElasticLoadBalancerResponse x
-> AttachElasticLoadBalancerResponse
$cfrom :: forall x.
AttachElasticLoadBalancerResponse
-> Rep AttachElasticLoadBalancerResponse x
Prelude.Generic)
newAttachElasticLoadBalancerResponse ::
AttachElasticLoadBalancerResponse
newAttachElasticLoadBalancerResponse :: AttachElasticLoadBalancerResponse
newAttachElasticLoadBalancerResponse =
AttachElasticLoadBalancerResponse
AttachElasticLoadBalancerResponse'
instance
Prelude.NFData
AttachElasticLoadBalancerResponse