module Network.AWS.CodeDeploy.GetDeploymentInstance
(
GetDeploymentInstance
, getDeploymentInstance
, gdiDeploymentId
, gdiInstanceId
, GetDeploymentInstanceResponse
, getDeploymentInstanceResponse
, gdirInstanceSummary
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
data GetDeploymentInstance = GetDeploymentInstance
{ _gdiDeploymentId :: Text
, _gdiInstanceId :: Text
} deriving (Eq, Ord, Read, Show)
getDeploymentInstance :: Text
-> Text
-> GetDeploymentInstance
getDeploymentInstance p1 p2 = GetDeploymentInstance
{ _gdiDeploymentId = p1
, _gdiInstanceId = p2
}
gdiDeploymentId :: Lens' GetDeploymentInstance Text
gdiDeploymentId = lens _gdiDeploymentId (\s a -> s { _gdiDeploymentId = a })
gdiInstanceId :: Lens' GetDeploymentInstance Text
gdiInstanceId = lens _gdiInstanceId (\s a -> s { _gdiInstanceId = a })
newtype GetDeploymentInstanceResponse = GetDeploymentInstanceResponse
{ _gdirInstanceSummary :: Maybe InstanceSummary
} deriving (Eq, Read, Show)
getDeploymentInstanceResponse :: GetDeploymentInstanceResponse
getDeploymentInstanceResponse = GetDeploymentInstanceResponse
{ _gdirInstanceSummary = Nothing
}
gdirInstanceSummary :: Lens' GetDeploymentInstanceResponse (Maybe InstanceSummary)
gdirInstanceSummary =
lens _gdirInstanceSummary (\s a -> s { _gdirInstanceSummary = a })
instance ToPath GetDeploymentInstance where
toPath = const "/"
instance ToQuery GetDeploymentInstance where
toQuery = const mempty
instance ToHeaders GetDeploymentInstance
instance ToJSON GetDeploymentInstance where
toJSON GetDeploymentInstance{..} = object
[ "deploymentId" .= _gdiDeploymentId
, "instanceId" .= _gdiInstanceId
]
instance AWSRequest GetDeploymentInstance where
type Sv GetDeploymentInstance = CodeDeploy
type Rs GetDeploymentInstance = GetDeploymentInstanceResponse
request = post "GetDeploymentInstance"
response = jsonResponse
instance FromJSON GetDeploymentInstanceResponse where
parseJSON = withObject "GetDeploymentInstanceResponse" $ \o -> GetDeploymentInstanceResponse
<$> o .:? "instanceSummary"