module Network.AWS.CodeDeploy.GetOnPremisesInstance
(
GetOnPremisesInstance
, getOnPremisesInstance
, gopiInstanceName
, GetOnPremisesInstanceResponse
, getOnPremisesInstanceResponse
, gopirInstanceInfo
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype GetOnPremisesInstance = GetOnPremisesInstance
{ _gopiInstanceName :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
getOnPremisesInstance :: Text
-> GetOnPremisesInstance
getOnPremisesInstance p1 = GetOnPremisesInstance
{ _gopiInstanceName = p1
}
gopiInstanceName :: Lens' GetOnPremisesInstance Text
gopiInstanceName = lens _gopiInstanceName (\s a -> s { _gopiInstanceName = a })
newtype GetOnPremisesInstanceResponse = GetOnPremisesInstanceResponse
{ _gopirInstanceInfo :: Maybe InstanceInfo
} deriving (Eq, Read, Show)
getOnPremisesInstanceResponse :: GetOnPremisesInstanceResponse
getOnPremisesInstanceResponse = GetOnPremisesInstanceResponse
{ _gopirInstanceInfo = Nothing
}
gopirInstanceInfo :: Lens' GetOnPremisesInstanceResponse (Maybe InstanceInfo)
gopirInstanceInfo =
lens _gopirInstanceInfo (\s a -> s { _gopirInstanceInfo = a })
instance ToPath GetOnPremisesInstance where
toPath = const "/"
instance ToQuery GetOnPremisesInstance where
toQuery = const mempty
instance ToHeaders GetOnPremisesInstance
instance ToJSON GetOnPremisesInstance where
toJSON GetOnPremisesInstance{..} = object
[ "instanceName" .= _gopiInstanceName
]
instance AWSRequest GetOnPremisesInstance where
type Sv GetOnPremisesInstance = CodeDeploy
type Rs GetOnPremisesInstance = GetOnPremisesInstanceResponse
request = post "GetOnPremisesInstance"
response = jsonResponse
instance FromJSON GetOnPremisesInstanceResponse where
parseJSON = withObject "GetOnPremisesInstanceResponse" $ \o -> GetOnPremisesInstanceResponse
<$> o .:? "instanceInfo"