module Network.AWS.CodeDeploy.GetApplication
(
GetApplication
, getApplication
, gaApplicationName
, GetApplicationResponse
, getApplicationResponse
, garApplication
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype GetApplication = GetApplication
{ _gaApplicationName :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
getApplication :: Text
-> GetApplication
getApplication p1 = GetApplication
{ _gaApplicationName = p1
}
gaApplicationName :: Lens' GetApplication Text
gaApplicationName =
lens _gaApplicationName (\s a -> s { _gaApplicationName = a })
newtype GetApplicationResponse = GetApplicationResponse
{ _garApplication :: Maybe ApplicationInfo
} deriving (Eq, Read, Show)
getApplicationResponse :: GetApplicationResponse
getApplicationResponse = GetApplicationResponse
{ _garApplication = Nothing
}
garApplication :: Lens' GetApplicationResponse (Maybe ApplicationInfo)
garApplication = lens _garApplication (\s a -> s { _garApplication = a })
instance ToPath GetApplication where
toPath = const "/"
instance ToQuery GetApplication where
toQuery = const mempty
instance ToHeaders GetApplication
instance ToJSON GetApplication where
toJSON GetApplication{..} = object
[ "applicationName" .= _gaApplicationName
]
instance AWSRequest GetApplication where
type Sv GetApplication = CodeDeploy
type Rs GetApplication = GetApplicationResponse
request = post "GetApplication"
response = jsonResponse
instance FromJSON GetApplicationResponse where
parseJSON = withObject "GetApplicationResponse" $ \o -> GetApplicationResponse
<$> o .:? "application"