module Network.AWS.OpsWorks.GetHostnameSuggestion
(
getHostnameSuggestion
, GetHostnameSuggestion
, ghsLayerId
, getHostnameSuggestionResponse
, GetHostnameSuggestionResponse
, ghsrsHostname
, ghsrsLayerId
, ghsrsStatus
) where
import Network.AWS.OpsWorks.Types
import Network.AWS.OpsWorks.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetHostnameSuggestion = GetHostnameSuggestion'
{ _ghsLayerId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getHostnameSuggestion
:: Text
-> GetHostnameSuggestion
getHostnameSuggestion pLayerId_ =
GetHostnameSuggestion'
{ _ghsLayerId = pLayerId_
}
ghsLayerId :: Lens' GetHostnameSuggestion Text
ghsLayerId = lens _ghsLayerId (\ s a -> s{_ghsLayerId = a});
instance AWSRequest GetHostnameSuggestion where
type Sv GetHostnameSuggestion = OpsWorks
type Rs GetHostnameSuggestion =
GetHostnameSuggestionResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
GetHostnameSuggestionResponse' <$>
(x .?> "Hostname") <*> (x .?> "LayerId") <*>
(pure (fromEnum s)))
instance ToHeaders GetHostnameSuggestion where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.GetHostnameSuggestion" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetHostnameSuggestion where
toJSON GetHostnameSuggestion'{..}
= object ["LayerId" .= _ghsLayerId]
instance ToPath GetHostnameSuggestion where
toPath = const "/"
instance ToQuery GetHostnameSuggestion where
toQuery = const mempty
data GetHostnameSuggestionResponse = GetHostnameSuggestionResponse'
{ _ghsrsHostname :: !(Maybe Text)
, _ghsrsLayerId :: !(Maybe Text)
, _ghsrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getHostnameSuggestionResponse
:: Int
-> GetHostnameSuggestionResponse
getHostnameSuggestionResponse pStatus_ =
GetHostnameSuggestionResponse'
{ _ghsrsHostname = Nothing
, _ghsrsLayerId = Nothing
, _ghsrsStatus = pStatus_
}
ghsrsHostname :: Lens' GetHostnameSuggestionResponse (Maybe Text)
ghsrsHostname = lens _ghsrsHostname (\ s a -> s{_ghsrsHostname = a});
ghsrsLayerId :: Lens' GetHostnameSuggestionResponse (Maybe Text)
ghsrsLayerId = lens _ghsrsLayerId (\ s a -> s{_ghsrsLayerId = a});
ghsrsStatus :: Lens' GetHostnameSuggestionResponse Int
ghsrsStatus = lens _ghsrsStatus (\ s a -> s{_ghsrsStatus = a});