{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.OpsWorks.AssociateElasticIP
(
associateElasticIP
, AssociateElasticIP
, aeiInstanceId
, aeiElasticIP
, associateElasticIPResponse
, AssociateElasticIPResponse
) where
import Network.AWS.Lens
import Network.AWS.OpsWorks.Types
import Network.AWS.OpsWorks.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AssociateElasticIP = AssociateElasticIP'
{ _aeiInstanceId :: !(Maybe Text)
, _aeiElasticIP :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateElasticIP
:: Text
-> AssociateElasticIP
associateElasticIP pElasticIP_ =
AssociateElasticIP' {_aeiInstanceId = Nothing, _aeiElasticIP = pElasticIP_}
aeiInstanceId :: Lens' AssociateElasticIP (Maybe Text)
aeiInstanceId = lens _aeiInstanceId (\ s a -> s{_aeiInstanceId = a})
aeiElasticIP :: Lens' AssociateElasticIP Text
aeiElasticIP = lens _aeiElasticIP (\ s a -> s{_aeiElasticIP = a})
instance AWSRequest AssociateElasticIP where
type Rs AssociateElasticIP =
AssociateElasticIPResponse
request = postJSON opsWorks
response = receiveNull AssociateElasticIPResponse'
instance Hashable AssociateElasticIP where
instance NFData AssociateElasticIP where
instance ToHeaders AssociateElasticIP where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.AssociateElasticIp" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateElasticIP where
toJSON AssociateElasticIP'{..}
= object
(catMaybes
[("InstanceId" .=) <$> _aeiInstanceId,
Just ("ElasticIp" .= _aeiElasticIP)])
instance ToPath AssociateElasticIP where
toPath = const "/"
instance ToQuery AssociateElasticIP where
toQuery = const mempty
data AssociateElasticIPResponse =
AssociateElasticIPResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
associateElasticIPResponse
:: AssociateElasticIPResponse
associateElasticIPResponse = AssociateElasticIPResponse'
instance NFData AssociateElasticIPResponse where