module Network.AWS.OpsWorks.GetHostnameSuggestion
(
GetHostnameSuggestion
, getHostnameSuggestion
, ghsLayerId
, GetHostnameSuggestionResponse
, getHostnameSuggestionResponse
, ghsrHostname
, ghsrLayerId
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.OpsWorks.Types
import qualified GHC.Exts
newtype GetHostnameSuggestion = GetHostnameSuggestion
{ _ghsLayerId :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getHostnameSuggestion :: Text
-> GetHostnameSuggestion
getHostnameSuggestion p1 = GetHostnameSuggestion
{ _ghsLayerId = p1
}
ghsLayerId :: Lens' GetHostnameSuggestion Text
ghsLayerId = lens _ghsLayerId (\s a -> s { _ghsLayerId = a })
data GetHostnameSuggestionResponse = GetHostnameSuggestionResponse
{ _ghsrHostname :: Maybe Text
, _ghsrLayerId :: Maybe Text
} deriving (Eq, Ord, Show)
getHostnameSuggestionResponse :: GetHostnameSuggestionResponse
getHostnameSuggestionResponse = GetHostnameSuggestionResponse
{ _ghsrLayerId = Nothing
, _ghsrHostname = Nothing
}
ghsrHostname :: Lens' GetHostnameSuggestionResponse (Maybe Text)
ghsrHostname = lens _ghsrHostname (\s a -> s { _ghsrHostname = a })
ghsrLayerId :: Lens' GetHostnameSuggestionResponse (Maybe Text)
ghsrLayerId = lens _ghsrLayerId (\s a -> s { _ghsrLayerId = a })
instance ToPath GetHostnameSuggestion where
toPath = const "/"
instance ToQuery GetHostnameSuggestion where
toQuery = const mempty
instance ToHeaders GetHostnameSuggestion
instance ToJSON GetHostnameSuggestion where
toJSON GetHostnameSuggestion{..} = object
[ "LayerId" .= _ghsLayerId
]
instance AWSRequest GetHostnameSuggestion where
type Sv GetHostnameSuggestion = OpsWorks
type Rs GetHostnameSuggestion = GetHostnameSuggestionResponse
request = post "GetHostnameSuggestion"
response = jsonResponse
instance FromJSON GetHostnameSuggestionResponse where
parseJSON = withObject "GetHostnameSuggestionResponse" $ \o -> GetHostnameSuggestionResponse
<$> o .:? "Hostname"
<*> o .:? "LayerId"