{-# 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.UpdateElasticIP
(
updateElasticIP
, UpdateElasticIP
, ueiName
, ueiElasticIP
, updateElasticIPResponse
, UpdateElasticIPResponse
) 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 UpdateElasticIP = UpdateElasticIP'
{ _ueiName :: !(Maybe Text)
, _ueiElasticIP :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateElasticIP
:: Text
-> UpdateElasticIP
updateElasticIP pElasticIP_ =
UpdateElasticIP' {_ueiName = Nothing, _ueiElasticIP = pElasticIP_}
ueiName :: Lens' UpdateElasticIP (Maybe Text)
ueiName = lens _ueiName (\ s a -> s{_ueiName = a})
ueiElasticIP :: Lens' UpdateElasticIP Text
ueiElasticIP = lens _ueiElasticIP (\ s a -> s{_ueiElasticIP = a})
instance AWSRequest UpdateElasticIP where
type Rs UpdateElasticIP = UpdateElasticIPResponse
request = postJSON opsWorks
response = receiveNull UpdateElasticIPResponse'
instance Hashable UpdateElasticIP where
instance NFData UpdateElasticIP where
instance ToHeaders UpdateElasticIP where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.UpdateElasticIp" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateElasticIP where
toJSON UpdateElasticIP'{..}
= object
(catMaybes
[("Name" .=) <$> _ueiName,
Just ("ElasticIp" .= _ueiElasticIP)])
instance ToPath UpdateElasticIP where
toPath = const "/"
instance ToQuery UpdateElasticIP where
toQuery = const mempty
data UpdateElasticIPResponse =
UpdateElasticIPResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
updateElasticIPResponse
:: UpdateElasticIPResponse
updateElasticIPResponse = UpdateElasticIPResponse'
instance NFData UpdateElasticIPResponse where